[R] Plotting Dates Time Series Data
Jeff Newmiller
jdnewmil at dcn.davis.ca.us
Mon Feb 1 06:39:22 CET 2016
Try ?xts or ?zoo packages instead of ts.
--
Sent from my phone. Please excuse my brevity.
On January 31, 2016 3:59:30 PM PST, Jeff Reichman <reichmanj at sbcglobal.net> wrote:
>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]]
>
>______________________________________________
>R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>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.
[[alternative HTML version deleted]]
More information about the R-help
mailing list