I have a .csv file containing 4 columns of data against a column of dates/times at one-minute intervals. Some timestamps are missing, so I'm trying to generate the missing dates/times and assign them NA values in the Y columns. I have previously done this with other .csv files with exactly the same formatting, with no issues. The code is:
# read the csv file har10 = read.csv(fpath, header=TRUE); # set date har10$HAR.TS
My data looks like this (for an entire year, more or less) after conversion to POSIXct, which seems to go fine:
HAR.TS C1 C2 C3 C4 1 2010-01-01 00:00:00 -4390.659 5042.423 -2241.6344 -2368.762 2 2010-01-01 00:01:00 -4391.711 5042.056 -2241.1796 -2366.725 3 2010-01-01 00:02:00 -4390.354 5043.003 -2242.5493 -2368.786 4 2010-01-01 00:03:00 -4390.337 5038.570 -2242.7653 -2371.289
When I the "convert to zoo" step I get the following error:
Warning message: In zoo(har10[, -1], har10[, 1]) : some methods for “zoo” objects do not work if the index entries in ‘order.by’ are not unique
I have checked for duplicated entries but get no results:
> anyDuplicated(har10) [1] 0
Any ideas? I have no idea why I'm getting this error on this file, but it has worked for previous ones. Thanks!
EDIT: Reproducable form:
EDIT 2: Have to remove the data/code, sorry!