Written in C++, this function should always run faster than
Numeric vector of values.
Integer vector of weights.
For optimal speed, choose the version of this function that matches the class of
weighted_mean_nn for numeric
weighted_mean_ni for numeric
weighted_mean_in for integer
weighted_mean_ii for integer
These functions typically execute several times faster than the base R function
weighted.mean and weighted average functions in other packages
wtd.mean in Hmisc and
wt.mean in SDMTools).
Dane R. Van Domelen
Acknowledgment: This material is based upon work supported by the National Science Foundation Graduate Research Fellowship under Grant No. DGE-0940903.
1 2 3 4 5 6 7
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.