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 his blog:
Timely Portfolio.
R-bloggers.com offers
daily e-mail updates about
R news and
tutorials on topics such as: visualization (
ggplot2,
Boxplots,
maps,
animation), programming (
RStudio,
Sweave,
LaTeX,
SQL,
Eclipse,
git,
hadoop,
Web Scraping) statistics (
regression,
PCA,
time series,
ecdf,
trading) and more...
If you got this far, why not
subscribe for updates from the site? Choose your flavor:
e-mail,
twitter,
RSS, or
facebook...
Tags: horizonplot, R