1

I am trying to gain the following result in this post: Aggregating hourly data into daily aggregates

However, i got stuck in reading the zoo file. I have run the following script on the attached data file

tab delimited file

#reading datafile
Temp6 <- read.table("Plot6_Temp.txt", header = TRUE, sep="\t")

anyDuplicated(Temp6$Time)
Temp6_corr <- Temp6[-c(3495),]

z <- read.zoo(Temp6_corr, header = TRUE, sep = "\t", format ="%d/%m/%Y %H:%M", tz="Europe/London")

I have tried for UTC time zone (as data is mostly stored in this format), as well as the suggested as.chron() function here:

Error in read.zoo index has bad entry at data row 2

And the correct format and utz settings as mentioned here:

Trouble finding non-unique index entries in zooreg time series

However, i get either the error: "index has bad entry at data row 3900", when running it with

tz = "Europe/London"

or the error: "some methods for “zoo” objects do not work if the index entries in ‘order.by’ are not unique" when running it with

tz = "UTC"

however running:

Temp6[c("3899", "3900", "3901"),]

Does not show any deviant values or strange entries for row 3900.

Adding: index.column = 1 , does not provide a solution either.

Any ideas?

Community
  • 1
  • 1
Soil33
  • 11
  • 2
  • Thanks to Joris Meys in the 'aggregate' blog post (first link) I have worked around it, however, for future projects I would still be interested in why these errors show up in the read.zoo() conversion. – Soil33 Mar 22 '17 at 14:39

0 Answers0