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

Vince Fulco vfulco1 at gmail.com
Sun Mar 8 05:41:30 CET 2009


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



More information about the R-SIG-Finance mailing list