[R] plotting a subset of a time series

Gabor Grothendieck ggrothendieck at gmail.com
Tue Mar 2 17:32:43 CET 2010


Try this:

plot(window(x, end = c(2006, 10)))

On Tue, Mar 2, 2010 at 2:19 AM, Erin Hodgess <erinm.hodgess at gmail.com> wrote:
> Dear R People:
>
> I have the following time series and plot:
>> x <- ts(rnorm(50),start=2005,freq=12)
>> plot(x)
>>
>
> which works fine.
>
> I would like to plot a subset of that time series, which I did with:
>> plot(window(x,2005,2006.83))
>
> Is there a better way to do this, please?
>
> Thanks,
> Erin
>
>
>
> --
> Erin Hodgess
> Associate Professor
> Department of Computer and Mathematical Sciences
> University of Houston - Downtown
> mailto: erinm.hodgess at gmail.com
>
> ______________________________________________
> 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.
>



More information about the R-help mailing list