How to use Plot.xts with Block and Events lines with xtsExtra package?

假如想象 提交于 2019-12-02 20:08:22

问题


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/.

  1. 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.

  2. 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

  1. 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"

  1. 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:

  1. 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.
  2. 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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!