[R] Plotting monthly timeseries with an x-axis in "time format"

From: vittorio <vdemart1_at_tin.it>
Date: Mon, 3 Dec 2007 18:11:47 +0100


I have the following timeseries "tab"



> str(tab)

 mts [1:23, 1:2] 79.5 89.1 84.9 75.7 72.8 ...

> tab

         Ipex...I Omel...E
Jan 2006    79.47    77.95
Feb 2006    89.13    76.73
Mar 2006    84.86    51.20
Apr 2006    75.68    51.86
May 2006    72.82    51.29
Jun 2006    78.87    49.45
Jul 2006    93.46    53.88
Aug 2006    78.18    47.96
Sep 2006    82.46    55.07
Oct 2006    77.25    45.34
Nov 2006    80.95    37.07
Dec 2006    84.39    37.53
Jan 2007    81.70    47.79
Feb 2007    74.76    37.50
Mar 2007    65.29    30.35
Apr 2007    60.30    37.78
May 2007    66.59    34.13
Jun 2007    73.19    39.14
Jul 2007    92.39    39.89
Aug 2007    65.76    35.46
Sep 2007    77.45    36.54
Oct 2007    74.22    38.39
Nov 2007   101.36    47.33
Dec 2007   100.01  45.34
===============================

Plotting tab with a simple "plot(tab,plot.type="single")" I'm obtaining a graph with the x axis in an orrible decimal format so that,e.g., Jan 2006 is 2006.0 and Nov 2006 is 2006.8(33)!

 Instead I would like to see the x-axis in a more human-readable format, for instance, 12 tics for each year and a label at the beginning of each quarter of the year: 2006.1, 2006.4,2006.7.

Please help.

Ciao
Vittorio



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Mon 03 Dec 2007 - 17:15:18 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 03 Dec 2007 - 20:30:17 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.