calc_returns | R Documentation |
Calculate individual daily returns of a dataframe containing multiple assets
calc_returns(df)
df |
dataframe containing asset prices, 'date' column is optional |
dataframe containing returns
df <- data.frame(spx = c(2850, 2820, 2890), ukx = c(7004, 7010, 7080)) calc_returns(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.