Description Usage Arguments Value References Examples
Useful for visualizing how two investments behave relate to each other, or how several investments behave relative to the same benchmark.
1 2 3 4 5 6 7 8 9 10 11 |
formula |
Formula, e.g. |
... |
Arguments to pass along with |
gains |
Data frame with one column of gains for each investment
mentioned in |
prices |
Data frame with one column of prices for each investment
mentioned in |
poly_order |
Numeric value specifying the polynomial order for linear
regression, e.g. |
plotly |
Logical value for whether to convert the
|
title |
Character string. |
base_size |
Numeric value. |
return |
Character string specifying what to return. Choices are
|
In addition to the graph, a list containing fitted linear regression models
returned by lm
for each investment vs. the benchmark.
Jeffrey A. Ryan and Joshua M. Ulrich (2019). quantmod: Quantitative Financial Modelling Framework. R package version 0.4-15. https://CRAN.R-project.org/package=quantmod
1 2 3 4 5 | ## Not run:
# Plot daily gains for SSO and UPRO vs. VFINX
p <- plot_gains(SSO + UPRO ~ VFINX)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.