[R] plot a single frequency of a ts object
jim at bitwrit.com.au
Thu Nov 7 02:53:47 CET 2013
On 11/07/2013 04:56 AM, Stefano Sofia wrote:
> Dear list users,
> I transformed two vectors of seasonal data in ts objects of frequency 4:
> y1<- ts(x1, frequency=4, start=c(1952,1))
> y2<- ts(x2, frequency=4, start=c(1952,1))
> In this way Qtr1 corresponds to Winters, Qtr2 corresponds to Springs and so on.
> I would like to plot on the same graph both y1 and all the Winters of y2.
> I am not able to find an easy and straightforward way to do that.
> Could somebody please help me in this?
This may do what you want:
y1 <- ts(x1, frequency=4, start=c(1952,1))
y2 <- ts(x2, frequency=4, start=c(1952,1))
More information about the R-help