Horizon Plots in Base Graphics
for background please see prior posts More on Horizon Charts, Application of Horizon Plots, Horizon Plot Already Available, and Cubism Horizon Charts in R
There are three primary graphics routes in R (base graphics, lattice, and ggplot2), and each have their zealots. Last time in More on Horizon Charts, I used lattice and latticeExtra. This time we will build horizon plots in base graphics, and I was pleased with the result. Unfortunately, there is one small issue in that the points of change from positive to negative overlap. Please let me know if you have a solution.
Now, let’s implement a for loop and mirror the negative values.
With horizon chart functionality in base graphics, hopefully we can add this type now to other packages. Here is a potential example using quantmod.
R code in GIST (do raw for copy/paste)
To leave a comment
for the author, please follow the link and comment on their blog: Timely Portfolio
offers daily e-mail updates
news and tutorials
on topics such as: Data science
, Big Data, R jobs
, visualization (ggplot2
), programming (RStudio
, Web Scraping
) statistics (regression
, time series
) and more...
If you got this far, why not subscribe for updates
from the site? Choose your flavor: e-mail
, or facebook