[R] Problem with merging two zoo objects

Gabor Grothendieck ggrothendieck at gmail.com
Sat Oct 16 04:00:29 CEST 2010


On Fri, Oct 15, 2010 at 9:56 PM, Megh Dal <megh700004 at yahoo.com> wrote:
> However I have noticed a strange thing. Placing of "tz = """ matters here:
>
>> head(read.zoo("f:/dat1.txt", sep = ",", header = TRUE, format =  "%m/%d/%Y %H:%M:%S"), tz = "")

Your tz argument has been passed as an argument of head.  You want it
as an argument of read.zoo .

>           data.open data.high data.low data.close
> 2010-10-15      73.7      73.7     73.7       73.7
> 2010-10-15      73.8      73.8     73.8       73.8
> 2010-10-15      73.8      73.8     73.8       73.8
> 2010-10-15      73.8      73.8     73.8       73.8
> 2010-10-15      73.8      73.8     73.8       73.8
> 2010-10-15      73.8      73.8     73.8       73.8
> Warning messages:
> 1: In zoo(rval3, ix) :
>  some methods for “zoo” objects do not work if the index entries in ‘order.by’ are not unique
> 2: In zoo(rval, x.index[i]) :
>  some methods for “zoo” objects do not work if the index entries in ‘order.by’ are not unique

You are missing the aggregate= argument to read.zoo which is needed if
you have duplicate times in your input to tell it how to resolve them.

-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com



More information about the R-help mailing list