calc.ret | R Documentation |
Created so that a return column is added to a dataframe with prices in the long (tidy) format.
calc.ret(P, tickers = rep("ticker", length(P)), type.return = "arit")
P |
Price vector |
tickers |
Ticker of symbols (usefull if working with long dataframe) |
type.return |
Type of price return to calculate: 'arit' (default) - aritmetic, 'log' - log returns. |
A vector of returns
P <- c(1,2,3) R <- calc.ret(P)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.