Re: [R] construct a data set

2011-07-28 Thread nandan amar
Dear Michael and Vettorazzi, Thanks. It was really helpful. I got the desired answer . Actually I had some weekly data and i wanted to put in ts class for some time series related test. Thanks a lot :) On Thu, Jul 28, 2011 at 8:20 PM, Eik Vettorazzi wrote: > Hi Amar, > you might have a look at ?t

Re: [R] construct a data set

2011-07-28 Thread Eik Vettorazzi
Hi Amar, you might have a look at ?ts, which creates time-series objects (as AirPassengers actually is, see class(AirPassengers)). hth Am 28.07.2011 11:27, schrieb nandan amar: > Hi, > i want to construct a data set similar to "AirPassengers". > Its attributes are following. > >> attributes(Air

Re: [R] construct a data set

2011-07-28 Thread R. Michael Weylandt
I'm a little confused: what is making data = 1:14 into a 12x12 matrix and how is that related to AirPassengers? Best I understand it, tsp is a little fun and included as an S legacy. If you want to access tsp directly, take a look at the tsp(x) function (and the associated hasTsp(x) function). If

Re: [R] construct a data set

2011-07-28 Thread nandan amar
Thanks a lot Michael, I wanted to create similar data set for weekly data, for say 2 weeks >data<-c(1,2,3,4,5,6,7,8,9,10,11,12,13,14) now i want to put data[ ] in the same structure as AirPassengers i.e. instead of 12x12 matrix AP2 should be a 2x7 matrix and with same attributes as AirPassengers

Re: [R] construct a data set

2011-07-28 Thread R. Michael Weylandt
Well, depending on how similar you want/need it to be, you could simply make a copy and directly modify it as desired; AP2 <- AirPassengers AP2$tsp <- c(3,4,5) # or whatever It's quick and dirty but sounds like it works for you. Write back if this isn't clear or if you care to provide more inf