[R] Multiple time series and their names

David Stoffer dsstoffer at gmail.com
Sat Oct 3 05:15:57 CEST 2009


Suppose I have multiple time series with names for each one, for example,

x <- ts(matrix(rnorm(30,0,1),10,3), names=c("Juan", "Tuey", "Trey"),
frequency=4)

So now, as I start to explore these series, if I do everything at once, the
names
stay attached to the series.  For example,
plot(x) # gives a plot of the series with their names
acf(x)  # gives the ACFs & CCFs with names attached

But if I want to explore what's going on with Juan, from what I can gather, 
I have to do something like this
plot(x[,1])
(or acf(x[,1])... or similar things) but this doesn't keep the name Juan.

My question: Is there a way, without making a data frame [which seems to
destroy the
time series attributes(??) - this seems to be the only answer I can find on
Rhelp] 
that allows me to keep track of the names?  That way, for example, I don't
have to 
remember that the 18th series is Martha.  

x$Juan, x$Tuey, x$Trey, would be nice ... but that doesn't work.

Thanks in advance.


-----
The power of accurate observation is commonly called cynicism 
by those who have not got it.  George Bernard Shaw
-- 
View this message in context: http://www.nabble.com/Multiple-time-series-and-their-names-tp25725411p25725411.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list