[R-SIG-Finance] Data and label skew in plot.timeSeries? (fCalendar)

Gabor Grothendieck ggrothendieck at gmail.com
Thu Aug 17 20:35:08 CEST 2006


I have not examined this in detail but its likely a time zone problem.
Try setting your time zone to "GMT"

setenv(TZ = "GMT")

at the start of your session and see if you still get the problem.  Also read
the help desk article in R News 4/1 on dates and times.

On 8/17/06, Peter Carl <pcarl at gsbalum.uchicago.edu> wrote:
> I've noticed that there seems to be some skew between the x-axis labels
> and the data points when using plot.timeSeries (in fCalendar).
>
> > benchmark.ts
>           S&P500TR
> 2002-12-31  -0.0588
> 2003-01-31  -0.0262
> 2003-02-28  -0.0150
> 2003-03-31   0.0097
> 2003-04-30   0.0824
> 2003-05-30   0.0527
> 2003-06-30   0.0128
> 2003-07-31   0.0176
> 2003-08-29   0.0195
> 2003-09-30  -0.0106
> 2003-10-31   0.0566
> 2003-11-28   0.0088
> 2003-12-31   0.0524
> 2004-01-30   0.0184
> 2004-02-27   0.0139
> 2004-03-31  -0.0151
> 2004-04-30  -0.0157
> 2004-05-31   0.0137
> 2004-06-30   0.0194
> 2004-07-30  -0.0331
> 2004-08-31   0.0040
> 2004-09-30   0.0108
> 2004-10-29   0.0153
> 2004-11-30   0.0405
> 2004-12-31   0.0340
> 2005-01-31  -0.0244
> 2005-02-28   0.0210
> 2005-03-31  -0.0177
> 2005-04-29  -0.0190
> 2005-05-31   0.0318
> 2005-06-30   0.0014
> 2005-07-29   0.0372
> 2005-08-31  -0.0091
> 2005-09-30   0.0081
> 2005-10-31  -0.0167
> 2005-11-30   0.0378
> 2005-12-30   0.0003
> 2006-01-31   0.0265
> > plot.timeSeries(benchmark.ts,format="%m/%y")
> > plot.timeSeries(benchmark.ts,format="%Y-%m-%d")
>
> Note that the x-axis labels are dated the following day (the first day
> of the next month) rather than the dates that were passed in with the
> timeSeries object.  So when viewing the x-axis as "%m/%y", the dates
> and the data do not appear to be lined up correctly.
>
> Am I missing something about how to use the function or is this a
> genuine bug?
> --
> Peter Carl
> 145 Scottswood Rd
> Riverside, IL 60546
> 708.447.6465
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>



More information about the R-SIG-Finance mailing list