Re: [R] which data structure for a set of time series ?

From: Spencer Graves <>
Date: Fri 14 Jul 2006 - 01:46:39 EST

          A data.frame is perfect for storing both qualitative and quantitative variables together when they all have more or less the same length and where the observations are connected by something like time. Without substantive common connection, people usually put variables in different data.frames.

          Have you reviewed the information on data.frames in "An Introduction to R", available via 'help.start()'? Also regarding coding time, have you reviewed the "zoo" vignette? (See, e.g., "".)

	  Hope this helps.
	  Spencer Graves

Roolio wrote:
> Hello,
> I'm a R newcomer and I'm wondering the kind of data structure that would
> best fit to my problem:
> my data are equities (stocks) : so I have a time serie (say 1 year of weekly
> data), and a bunch of qualitative + quantitative variables :
> the sector of the stock (biotech/finance...), the geographical region, the
> name, ISIN code, P/E ratios, whatever...
> The data.frame is perfect for the qualitative variables : a row is a stock,
> a column is a variable .
> But where can I store the time serie? If I put each weekly data in a column
> of the data frame
> , I'm not sure that it's the best structure when I will want to test
> some models on these
> (regressions/arma/whatever).
> I would prefer to have a new data frame, where each column is a stock, each
> row a date, to do the regressions (across time more easily)
> So I would end up with 2 data frames, one of each transposed... No good,
> probably.
> I thought of a set of 2 objects : 1 data frame (for the qualitative
> variables), and one list of time series, in the same order, with the risk of
> forgetting to subset one objet and not the other, etc...
> Do you happen to have the same kind of problem?
> Is there something equivalent in R as the matlab 'structures' ? (kinda R
> data frame, where you can store multi-dimensional objects in a column)
> Many thanks in advance.
> Regards
> Roolio
> [[alternative HTML version deleted]]
> ______________________________________________
> mailing list
> PLEASE do read the posting guide! mailing list PLEASE do read the posting guide! Received on Fri Jul 14 02:27:28 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 14 Jul 2006 - 04:14:33 EST.

Mailing list information is available at Please read the posting guide before posting to the list.