问题
I am trying to plot time series graph with blocks as others did. See the link for more detail of the example: http://www.r-bloggers.com/plot-xts-is-wonderful/.
Firstly, I installed all newest xts (ver:0.9.874) and xtsExtra (ver: 0.0.876) packages from R-Forge: https://r-forge.r-project.org/R/?group_id=118.
Then I tried to load xtsExtra and it shows as follows:
library(xtsExtra)
Attaching package: ‘xtsExtra’ The following objects are masked from ‘package:xts’: addLegend, addSeries, plot.xts
- When I look at the "plot.xts" components, I didn't see "blocks" and "events".
names(formals(plot.xts)) [1] "x" "y" "..." "subset" "FUN" "panels"
[7] "multi.panel" "col" "up.col" "dn.col" "type" "lty"
[13] "lwd" "lend" "main" "clev" "cex" "cex.axis"
[19] "mar" "srt" "xaxis.las" "ylim" "yaxis.same" "yaxis.left"
[25] "yaxis.right" "grid.ticks.on" "grid.ticks.lwd" "grid.ticks.lty" "grid.col" "labels.col"
[31] "format.labels" "shading" "bg.col" "grid2" "legend.loc"
- Finally when I used plot.xts, it shows the following message. Warning message: xtsExtra::plot.xts is deprecated, use xts::plot.xts
I really appreciate it if anyone can tell me:
- If these packages versions are the right ones or not. If not, where are the old versions of xts and xtsExtra that had "blocks" and "events" functions.
- If these new versions can do the same thing, how?
Please let me know if you need the data to try and I will provide separately since it is big.
回答1:
We've moved plot.xts into the main xts package.
Please do
install.packages("xts", repos="http://R-Forge.R-project.org")
or
install_github('joshuaulrich/xts')
and then look at ?plot.xts and ?addEventLines for examples.
来源:https://stackoverflow.com/questions/29241784/how-to-use-plot-xts-with-block-and-events-lines-with-xtsextra-package