Calculates vector of ratios of a numeric vector, i.e. ratio of x to x, ratio of x to x, and so forth.
This function uses C++ code to achieve a 1.5-2 times speed increase compared to the base R code: len <- length(prices); prices[2: len] / prices[1: (len - 1)].
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 8 9
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.