Benchmarking R Speed

Want to learn more? I recommend working through: R for Data Science, R Cookbook, and R Graphics Cookbook.

# how long does it take R to create a huge sequence of numbers?
system.time(1:10000000)
   user  system elapsed
  0.037   0.014   0.053
# how long does it take R to create a equally long set of random draws
system.time(runif(10000000))
   user  system elapsed
  0.392   0.028   0.436