Skip to content

Commit

Permalink
Alter erronous 'neval' microbenchmark() argument to 'times' in Chapte…
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Thomson authored Mar 28, 2020
1 parent 66c8797 commit 4cdacc7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 01-introduction.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4cdacc7

Please sign in to comment.