Description Usage Arguments Value Examples
Useful for comparing funds on one or more metrics.
1 2 3 4 5 6 7 8 |
gains |
Data frame with one column of gains for each investment and a date variable named Date. |
metrics |
Character vector specifying metrics to calculate. Choices are
|
prices |
Data frame with one column of prices for each investment and a date variable named Date. |
tickers |
Character vector of ticker symbols that Yahoo! Finance recognizes, if you want to download data on the fly. |
... |
Arguments to pass along with |
benchmark |
Character string specifying which fund to use as a benchmark for metrics that require one. |
Data frame with performance metrics for each investment.
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
# Calculate performance metrics for FANG stocks since the beginning of 2019
calc_metrics(tickers = fang, from = "2019-01-01")
# Repeat, but use step-by-step approach with piping (need SPY to calculate
# alpha and beta)
c("SPY", fang) %>%
load_gains(from = "2019-01-01") %>%
calc_metrics()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.