<p>thanks .. and it did work! but i see some jagged lines in between the years, typically like the one joining dec of previous year and oct of the successive year. Is this how it would look like? can it be made better?<br />
<br />
have included the plot!<br />
<br />
heres the code..!<br />
<br />
x.date <- as.Date(paste(chn.arr[,1], chn.arr[,2], chn.arr[,3], sep="-"))<br />
ts.chn <- ts(chn.arr[1:2386,4])<br />
z.chn <- zoo(ts.chn, x.date)<br />
plot(z.chn, main = "Rainfall variations", xlab = "Year", ylab="Daily rainfall (mm)")<br />
<br />
<!--begin_signature-->-- <br />
Regards,<br />
Mahalakshmi<br />
Graduate Student<br />
#20, Department of Geography<br />
Michigan State University<br />
East Lansing, MI 48824<!--end_signature--></p>
Quoting steven mosher <moshersteven@gmail.com>:<br />
<br />
> I would look at using the package 'zoo' your time series data would be a<br />
> zoo object<br />
> and then your date data would be coerced as well,<br />
><br />
> zoo, is very slick.<br />
><br />
> On Thu, Nov 4, 2010 at 12:18 PM, <govindas@msu.edu> wrote:<br />
><br />
>><br />
>><br />
>> Hi all,<br />
>><br />
>> I have a matrix as given below...<br />
>><br />
>> year month day prec<br />
>> 1 1980 10 1 13.4<br />
>> 2 1980 10 2 0.0<br />
>> 3 1980 10 3 0.0<br />
>> 4 1980 10 4 0.0<br />
>> 5 1980 10 5 0.0<br />
>> 6 1980 10 6 0.0<br />
>> 7 1980 10 7 0.0<br />
>> 8 1980 10 8 0.0<br />
>> 9 1980 10 9 0.0<br />
>> 10 1980 10 10 0.0<br />
>> 11 1980 10 11 7.4<br />
>> 12 1980 10 12 5.4<br />
>> 13 1980 10 13 7.2<br />
>> 14 1980 10 14 0.0<br />
>> 15 1980 10 15 0.0<br />
>> 16 1980 10 16 0.0<br />
>> 17 1980 10 17 41.2<br />
>> 18 1980 10 18 0.0<br />
>> 19 1980 10 19 0.0<br />
>> 20 1980 10 20 0.0<br />
>> 21 1980 10 21 0.0<br />
>> 22 1980 10 22 0.0<br />
>> 23 1980 10 23 0.0<br />
>> 24 1980 10 24 0.0<br />
>> 25 1980 10 25 0.0<br />
>> 26 1980 10 26 0.0<br />
>> 27 1980 10 27 2.0<br />
>> 28 1980 10 28 0.0<br />
>> 29 1980 10 29 0.0<br />
>> 30 1980 10 30 0.0<br />
>> 31 1980 10 31 0.0<br />
>> 32 1980 11 1 0.0<br />
>> 33 1980 11 2 0.0<br />
>> 34 1980 11 3 0.0<br />
>> 35 1980 11 4 0.0<br />
>> 36 1980 11 5 12.4<br />
>><br />
>> the precipitation values extend from 1980 to 2005, but only for october,<br />
>> november and december. I would like to plot just these 3 months for the<br />
>> given time period (1980 - 2005). Is there a way to get these values in the<br />
>> x-axis. i.e. i need a plot with its axis reading "1980, 1981, 1982 .. 2005"<br />
>> (even if the months are specified then it should be of more use). for now,<br />
>> i get an axis like .. "0, 500, ... 2000" (the plot is giving the index<br />
>> values).<br />
>><br />
>> i tried changing the freq as given below, but did not work!<br />
>> ts.chn <- ts(chn.arr[1:2386,4], start=c(1980, 10), end=c(2005, 12),<br />
>> freq=365)<br />
>> plot(ts.chn)<br />
>><br />
>> --<br />
>> Regards,<br />
>> Mahalakshmi<br />
>> Graduate Student<br />
>> #20, Department of Geography<br />
>> Michigan State University<br />
>> East Lansing, MI 48824<br />
>> [[alternative HTML version deleted]]<br />
>><br />
>><br />
>> _______________________________________________<br />
>> R-sig-Geo mailing list<br />
>> R-sig-Geo@stat.math.ethz.ch<br />
>> <a href="https://stat.ethz.ch/mailman/listinfo/r-sig-geo" target="_blank">https://stat.ethz.ch/mailman/listinfo/r-sig-geo</a><br />
>><br />
>><br />
><br />