sumcpp | R Documentation |
This function uses the accu()
function from the Armadillo
library, a C++ library for linear algebra and
scientific computing. For double-Precision vectors, the run time of this function is faster than the base
sum()
function, making it better suited for summing the weight
variable with > 3000 elements.
sumcpp(x)
x |
A numeric vector. |
A numeric vector.
# Summing a double vector x <- runif(1000000, 0.0000001, 1.99999999) sumcpp(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.