| panel_returns_simple | R Documentation |
Converts a wide price panel (Date + symbols) into arithmetic simple returns at the same cadence, dropping the first row per symbol.
panel_returns_simple(prices)
prices |
A data frame or data.table with columns |
A data frame with Date and one column per symbol containing simple returns
R_{t} = P_{t}/P_{t-1} - 1.
data(sample_prices_weekly)
rets <- panel_returns_simple(sample_prices_weekly)
head(rets)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.