[R] loading data into ZOO

Brian G. Peterson brian at braverock.com
Wed Dec 23 21:28:04 CET 2009


Stephen J. Barr wrote:
> I have a simple question. I am trying to load data into a zoo object. I have
> the data in CSV format as follows
> 
> SYMBOL DATE             TIME              PRICE
> XX            YYYYMMDD HH:MM:SS      n.nn
> 
> and there are multiple symbols in this one data frame.
> 
> My question is, do I need to merge DATE and TIME before loading them or can
> I specify multiple index.column or index.name fields?

index.column in read.zoo is a single column only

you can either merge in your CVS format, simplifying things in R, or use 
read.table to get the data into R and then merge your index columns when you 
call as.zoo.

Regards,

     - Brian

-- 
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock




More information about the R-help mailing list