Displaying 2 results from an estimated 2 matches for "yourloop".
Did you mean:
curloop
2023 Oct 15
2
Create new data frame with conditional sums
...[13,] 0.12 8000
> [14,] 0.13 3900
> [15,] 0.14 3900
> [16,] 0.15 3900
>
> Here are some timings:
>
> > microbenchmark::microbenchmark(
> + preallocate=with(dummydata, f2(seq(0, 0.15, by=0.01),
> + Pct, Totpop)),
> + yourloop=with(dummydata, f1(seq(0, 0.15, by=0.01),
> + Pct, Totpop)),
> + sapply=with(dummydata, f3(seq(0, 0.15, by=0.01),
> + Pct, Totpop)),
> + times=1000
> + )
> Unit: microseconds
> expr min lq mean...
2023 Oct 14
1
Create new data frame with conditional sums
...0.09 12700
[11,] 0.10 8000
[12,] 0.11 8000
[13,] 0.12 8000
[14,] 0.13 3900
[15,] 0.14 3900
[16,] 0.15 3900
Here are some timings:
> microbenchmark::microbenchmark(
+ preallocate=with(dummydata, f2(seq(0, 0.15, by=0.01),
+ Pct, Totpop)),
+ yourloop=with(dummydata, f1(seq(0, 0.15, by=0.01),
+ Pct, Totpop)),
+ sapply=with(dummydata, f3(seq(0, 0.15, by=0.01),
+ Pct, Totpop)),
+ times=1000
+ )
Unit: microseconds
expr min lq mean median uq max neval cld
pr...