I'm trying to read a set of csv datasets into R as zoo time series. I've managed to convert the data into data frames with the index columns as dates and the rest as numeric vectors. I now need to convert these data frame into zoo. Here's the code I'm using:
for(x in 1:length(files)){
for(n in 1:length(files[[x]]){
files[[x]][[n]]<-unique(files[[x]][[n]]) #removes duplicate rows
}
zfiles[[x]]<-lapply(files[[x]],function(n) read.zoo(n))
}
Upon running it I get this error: Error in read.zoo(n) : index has bad entry at data row 4
I've tried randomly converting individual datasets within files
and i do not get any error, so I'm assuming there are certain problem sets which cause the issue. Is there any way to remove the bad entries before converting to zoo?
Thanks