From 4cdacc719875cde812b220196a01095d92cd9adc Mon Sep 17 00:00:00 2001 From: Geoffrey Thomson Date: Sat, 28 Mar 2020 06:22:16 -0400 Subject: [PATCH] Alter erronous 'neval' microbenchmark() argument to 'times' in Chapter 1 (#254) --- 01-introduction.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/01-introduction.Rmd b/01-introduction.Rmd index 91c831f8..ecfef418 100644 --- a/01-introduction.Rmd +++ b/01-introduction.Rmd @@ -239,7 +239,7 @@ microbenchmark(cs_for(x), cs_apply(x), cumsum(x)) 1. Which method is fastest and how many times faster is it? -2. Run the same benchmark, but with the results reported in seconds, on a vector of all the whole numbers from 1 to 50,000. Hint: also use the argument `neval = 1` so that each command is only run once to ensure the results complete (even with a single evaluation the benchmark may take up to or more than a minute to complete, depending on your system). Does the *relative* time difference increase or decrease? By how much? +2. Run the same benchmark, but with the results reported in seconds, on a vector of all the whole numbers from 1 to 50,000. Hint: also use the argument `times = 1` so that each command is only run once to ensure the results complete (even with a single evaluation the benchmark may take up to or more than a minute to complete, depending on your system). Does the *relative* time difference increase or decrease? By how much? ```{r, eval=FALSE, echo=FALSE} x = 1:5e4 # initiate vector to cumulatively sum