powered by
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)
A data frame with Date and one column per symbol containing simple returns \(R_{t} = P_{t}/P_{t-1} - 1\).
Date
A data frame or data.table with columns Date and one column per symbol containing adjusted prices at a common frequency (daily, weekly, monthly).
# \donttest{ data(sample_prices_weekly) rets <- panel_returns_simple(sample_prices_weekly) head(rets) # }
Run the code above in your browser using DataLab