Skip to content
Prev 212225 / 398500 Next

plotting a subset of a time series

The indexing in xts is very nice; it may do what you want.

library(xts)
x.xts <- as.xts(x)
plot(x.xts)
plot(x.xts['2005::2006-10'])

HTH,
David Reiner

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On Behalf Of Erin Hodgess
Sent: Tuesday, March 02, 2010 1:20 AM
To: R help
Subject: [R] plotting a subset of a time series

Dear R People:

I have the following time series and plot:
which works fine.

I would like to plot a subset of that time series, which I did with:
Is there a better way to do this, please?

Thanks,
Erin