I am trying to plot a chart of some data I have loaded into R. But I only want a chart from one specific time period to another. How does one restrict on the sample of the data for certain time periods, say from 09/20/2010 to 09/23/2010.
If I used the "xts" package in R, I think one can simple state:
plot(dat$weight['2010-09-20/2010-09-23'])
But this format isn't working on the zoo package. Can anyone help?
library(zoo)
dat=read.zoo("filelocation",header=T,colClasses=c("Date","numeric"))
date weight
2010-10-04 52495
2010-10-01 53000
2010-09-30 52916
2010-09-29 52785
2010-09-28 53348
2010-09-27 52885
2010-09-24 52174
2010-09-23 51461
2010-09-22 51286
2010-09-21 50968
2010-09-20 49250