compute_return | R Documentation |
compute_return
computes simple or logarithmic returns for a vector
of values. The function uses calc_simple_return
and
calc_log_return
.
compute_return(x = NULL, type = c("simple", "log"))
x |
numeric vector |
type |
either "simple" or "log" |
Used in scripts: Robust function: TRUE
If x
is a vector of length > 1, returns a vector of equal
length to input vector with returns and codeNA_real_ in first position
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.