Description Usage Arguments Value Examples
Written in C++, this function runs faster than mean
for
large integer vectors/matrices.
1 | mean_i(x)
|
x |
Integer vector or matrix. |
Numeric value.
1 2 3 4 5 6 7 8 9 | # For very large integer objects, sum_i is faster than sum
x <- rpois(100000, lambda = 5)
mean(x) == mean_i(x)
benchmark(mean(x), mean_i(x), replications = 1000)
# For smaller integer objects, sum_i is slower than sum
x <- rpois(1000, lambda = 5)
mean(x) == mean_i(x)
benchmark(mean(x), mean_i(x), replications = 1000)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.