Re: [R] question about time series objects

2010-01-30 Thread Dipankar Basu
Thanks a lot; this helps a lot. On Sat, Jan 30, 2010 at 11:07 AM, Gabor Grothendieck < ggrothendi...@gmail.com> wrote: > See ?window.ts, e.g. > > > # 1 > > tt <- ts(c(0.71, 0.63, 0.85, 0.44, 0.61, 0.69, 0.92, 0.55), > + start = 1960, frequency = 4) > > at <- c(1961, 3) > > window(tt, at, at)[1]

Re: [R] question about time series objects

2010-01-30 Thread Gabor Grothendieck
See ?window.ts, e.g. > # 1 > tt <- ts(c(0.71, 0.63, 0.85, 0.44, 0.61, 0.69, 0.92, 0.55), + start = 1960, frequency = 4) > at <- c(1961, 3) > window(tt, at, at)[1] [1] 0.92 Note that 1961.00, 1961.25, 1961.50 and 1961.75 represent the 4 quarters of 1961 so this also works: # 2 > window(tt, 1961

Re: [R] question about time series objects

2010-01-30 Thread David Winsemius
On Jan 30, 2010, at 9:22 AM, Dipankar Basu wrote: Hi All, I have a very simple question about a time series object: how to access values for a particular year and quarter (say)? Suppose, following http://www.stat.pitt.edu/stoffer/tsa2/R_time_series_quick_fix.htm I have read in data as a

[R] question about time series objects

2010-01-30 Thread Dipankar Basu
Hi All, I have a very simple question about a time series object: how to access values for a particular year and quarter (say)? Suppose, following http://www.stat.pitt.edu/stoffer/tsa2/R_time_series_quick_fix.htm I have read in data as a time series; here is how it looks. * Qtr1 Qtr2 Q