Skip to content

zoo library and unique error...

2 messages · Vince Fulco, Gabor Grothendieck

#
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
#
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: