[R-SIG-Finance] zoo library and unique error...

Gabor Grothendieck ggrothendieck at gmail.com
Sun Mar 8 11:23:07 CET 2009


That won't make the times unique -- it will only ensure that
of the es2.raw rows with identical times that no two have the same
value in all other columns.

See zoo faq #1:

library(zoo)
vignette("zoo-faq")

On Sat, Mar 7, 2009 at 11:41 PM, Vince Fulco <vfulco1 at gmail.com> wrote:
> I'm puzzled by a recurring warning re: "some methods for 'zoo' objects
> do not work if the index entries in ‘order.by’ are not unique."
>
> The data is machine generated in specific, unique, ordered increments
> and I've tried to manipulate this zoo object as well as running the
> index(foo) through a  make.unique function but the warning continues
> to surface. It then causes calculations in the script further down to
> balk.  Prior Q&A re: this error indicate 1) the index or the 2) file
> using read.zoo, must have a make.unique func() applied to it. But this
> application doesn't alter the warnings or provides mean values which I
> don't want.
>
> rm(list=ls());
> #
>
> require(zoo)
> require(quantmod)
>
> es.raw<- read.table('C://IBrtdata/ESdat030609.dat', as.is=T, sep=',')
> names(es.raw)<- c('dtetme', 'O', 'H', 'L', 'C', 'VOL', 'WAP', 'GAPS', 'CNT')
>
> es.raw2<- strptime(es.raw[,1], '%Y-%m-%d %H:%M:%S')
> es.raw2<- unique(es.raw2)
>
> es.raw3<- zoo(es.raw[,-c(1)],es.raw2)
> #
> Warning message:
> In zoo(es.raw[, -c(1)], es.raw2) :
>  some methods for “zoo” objects do not work if the index entries in
> ‘order.by’ are not unique
> --
>
> TIA,
>
> Vince Fulco, CFA, CAIA
> 612.424.5477 (universal)
> vfulco1 at gmail.com
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
>



More information about the R-SIG-Finance mailing list