Re: [R] extracting year an month from ts data set

2007-11-27 Thread Gabor Grothendieck
If x is your series cycle(x) gives the months and floor(time(x)) gives the years. On Nov 27, 2007 7:57 PM, Richard Saba <[EMAIL PROTECTED]> wrote: > I have an ascii data set of monthly observation starting in Jan 1946 with a > header. > > hstarts > 57 > 65 > 95 > 103 > 103 > 97 > 94 > . > . > . >

Re: [R] extracting year an month from ts data set

2007-11-27 Thread Moshe Olshansky
In your case months <- rep(1:12,len=length(tab6.1)) should work. --- Richard Saba <[EMAIL PROTECTED]> wrote: > I have an ascii data set of monthly observation > starting in Jan 1946 with a > header. > > hstarts > 57 > 65 > 95 > 103 > 103 > 97 > 94 > . > . > . > > Which I read with the follow

[R] extracting year an month from ts data set

2007-11-27 Thread Richard Saba
I have an ascii data set of monthly observation starting in Jan 1946 with a header. hstarts 57 65 95 103 103 97 94 . . . Which I read with the following code tab6.1<-ts(read.table(fname, header=TRUE),frequency=12,start=c(1946,1)) I would like to run a time series model with dummy variabl