[R] Re:Time-Series

Achim Zeileis Achim.Zeileis at wu-wien.ac.at
Thu Jan 13 14:30:47 CET 2005


On Thu, 13 Jan 2005 13:54:43 +0100 (CET) Vito Ricci wrote:

> Hi,
> 
> you can address to a single ts in a multivariate ts
> object by namets[,index]. See this example:

Note, that index can also be a string and not only the index number. You
wanted to have the analogue of z$energy which could also be
  z[, "energy"]

hth,
Z

> > dati
>     X   Y
> 1 100 200
> 2 150 210
> 3 180 220
> 4 200 230
> 5 220 250
> > serie<-ts(dati,start=1999)
> > serie
> Time Series:
> Start = 1999 
> End = 2003 
> Frequency = 1 
>        X   Y
> 1999 100 200
> 2000 150 210
> 2001 180 220
> 2002 200 230
> 2003 220 250
> 
> > serie[,1] ## first ts
> Time Series:
> Start = 1999 
> End = 2003 
> Frequency = 1 
> [1] 100 150 180 200 220
> > serie[,2] ## second ts
> Time Series:
> Start = 1999 
> End = 2003 
> Frequency = 1 
> [1] 200 210 220 230 250
> 
> Regards
> Vito
> 
> 
> you wrote:
> 
> In a dataframe you call one of the variable (or the
> column) connecting the 
> name of the column to the dataframe name by means of
> the $ sign:
> so z$energy is the column named energy in the
> dataframe z.
> 
> I don't know  how to do the same with a multi-variable
> time-series. I tried 
> both z.energy, z$energy to no avail.
> 
> What's the right synthax?
> 
> Ciao
> Vittorio
> 
> =====
> Diventare costruttori di soluzioni
> Became solutions' constructors
> 
> "The business of the statistician is to catalyze 
> the scientific learning process."  
> George E. P. Box
> 
> Top 10 reasons to become a Statistician
> 
>      1. Deviation is considered normal
>      2. We feel complete and sufficient
>      3. We are 'mean' lovers
>      4. Statisticians do it discretely and continuously
>      5. We are right 95% of the time
>      6. We can legally comment on someone's posterior distribution
>      7. We may not be normal, but we are transformable
>      8. We never have to say we are certain
>      9. We are honestly significantly different
>     10. No one wants our jobs
> 
> 
> Visitate il portale http://www.modugno.it/
> e in particolare la sezione su Palese 
> http://www.modugno.it/archivio/palese/
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list