[R-SIG-Finance] Missing tick mark labels from barChart / quantmod - plot.xts missing
Jeff Ryan
jeff.a.ryan at gmail.com
Sun Nov 16 16:47:06 CET 2008
Hi Wind,
plot.xts is there, just not exported. This means it gets called when
an xts object is passed to plot()
xts:::plot.xts
That aside, the issue is somewhere else. I have tried the CRAN
release, the R-forge package, and the dev code on R-forge and all seem
to show an x axis with dates.
There may be a formatting issue with Windows and the release you have
not showing line breaks in the date (windows doesn't recognize this).
Try using this version (though probably won't fix either):
install.packages("xts",repos="http://R-Forge.R-project.org")
chartSeries and plot.xts use axTicksByTime to format the labels. The
issue most likely is that of the line breaks.
All of the above have been fixed in not yet released /dev branch of
xts. We are hoping to have that ready in the next few weeks.
Jeff
On Sun, Nov 16, 2008 at 3:24 AM, 风 <windspeedo at qq.com> wrote:
> Dear Jeff and R experts,
> I wonder whether you have received the previous email on this matter.
> I have narrow the problem to plot.xts missing.
>
>>require(quantmod)
> Loading required package: quantmod
> Loading required package: xts
> Loading required package: zoo
> Attaching package: 'zoo'
> The following object(s) are masked from package:base :
> as.Date.numeric
> Loading required package: Defaults
> quantmod: Quantitative Financial Modelling Framework
> Version 0.3-6, Revision 433
> http://www.quantmod.com
>
>>getSymbols('AAPL')
> [1] "AAPL"
>>barChart(AAPL)
> #successful. But NO date label for x axis labels.
>>a<-Cl(AAPL)
>>class(a)
> [1] "xts" "zoo"
>>plot.zoo(a)
> #successful. There are annual label for x axis major ticks.
>>chartSeries(a)
> Error in sum(poss.new) : invalid 'type' (list) of argument
>>plot(a)
> #no date label for x axis ticks
>>plot(as.xts(a))
> #same graph as the above. still no date label for x axis ticks
>>plot.xts(a)
> Error: could not find function "plot.xts"
>> ?plot.xts
> #the help window for plot.xts poped up.
>
>>library(help=xts)
> #window poped up with the following content:
> Version: 0.0-15
> Revision: 139
> Date: 2007-06-04
> Author: Jeffrey A. Ryan, Josh M. Ulrich
> Depends: zoo
> ...
> License: GPL-3
> URL: http://r-forge.r-project.org/projects/xts/
> Packaged: Mon Jun 9 23:47:46 2008; jryan
> Built: R 2.7.2; i386-pc-mingw32; 2008-10-15 23:19:56; windows
> Index:
> ...
> plot.xts Plotting xts Objects
> ...
>
> It seems that plot.zoo does its job but plot.xts may have some problem.
>
> Besides, the OS is Vista Oem on a notebook. R is 2.7.2 or 2.8.0.
>
> I wonder whether it is enough for R experts to diagnose the problem.
> Thanks.
>
> Wind
--
Jeffrey Ryan
jeffrey.ryan at insightalgo.com
ia: insight algorithmics
www.insightalgo.com
More information about the R-SIG-Finance
mailing list