[R] Plotting Dates Time Series Data

Jeff Reichman reichmanj at sbcglobal.net
Mon Feb 1 00:59:30 CET 2016


R-Help Users

 

How do I plot "Dates" on the x-axis of a TS plot 

 

>
mydata<-c(575,125,950,5020,2515,565,135,945,5100,2510,580,140,955,5045,2505,
570,135,1000,5005,2520,580,130,925,5000,2525,585,120,960,5025,2520)

> myts<-ts(mydata,start=as.Date("2015-01-01"))

> myts

Time Series:

Start = 16436 

End = 16465 

Frequency = 1 

 [1]  575  125  950 5020 2515  565  135  945 5100 2510  580  140  955 5045
2505

[16]  570  135 1000 5005 2520  580  130  925 5000 2525  585  120  960 5025
2520

> plot.ts(myts)

 

I'm assuming I have to reformat my start date values.  I just assume R would
do that.


	[[alternative HTML version deleted]]



More information about the R-help mailing list