Skip to content

recommended zoo merge for multiple objects

6 messages · zubin, Joshua Ulrich, Brian G. Peterson +1 more

#
zubin wrote:
Use cbind with xts.  xts extends zoo, and should be preferred for 
financial time series.

Regards,

  - Brian
#
Thx!

One question:  Will cbind use the time index?  I want to make sure 
everything lines up, as i have lags in the data.
Brian G. Peterson wrote:
#
On Fri, Oct 9, 2009 at 12:43 PM, zubin <binabina at bellsouth.net> wrote:
How did you conclude merge.zoo can only handle 2 objects?  Read ?merge.zoo...

Arguments:

     ...: two or more objects, usually of class '"zoo"'.

Best,
Josh
--
http://www.fosstrading.com
#
zubin wrote:
Yes, xts will use the time index for cbind, rbind, merge, etc.  I 
regularly use xts to line up irregular high frequency data.  xts has 
date and time-based subsetting which is very useful for financial time 
series.

As Josh has already pointed out, merge.zoo will take more than two 
objects to merge as well, but in my opinion you should be using xts 
anyway for most financial time series data.  I "fall back" to zoo when I 
need to make things that look more like data frames, or sometimes for 
loading data into R from poorly organized files.

Regards,

    - Brian

  
    
#
merge.zoo can handle any number of zoo objects.  There is *no*
limitation to two objects. There are examples in the examples section
at the end of ?merge.zoo
On Fri, Oct 9, 2009 at 1:43 PM, zubin <binabina at bellsouth.net> wrote: