I have this time series data:
"timestamp" "depth" "from_sensor_to_river_bottom" "Depth_from_river_surface_to_bottom"
"1" "2012-05-23 18:30:12-05" 16.4 17.16 0.760000000000002
"2" "2012-05-23 18:15:08-05" 16.38 17.16 0.780000000000001
"3" "2012-05-23 18:00:03-05" 16.39 17.16 0.77
"4" "2012-05-23 17:45:13-05" 16.35 17.16 0.809999999999999
"5" "2012-05-23 17:30:08-05" 16.37 17.16 0.789999999999999
I am using the following code:
d <- read.table(Name[1], header=TRUE) #Name[1] is text file containing data
d <- read.zoo(d,
format="'%Y-%m-%d %H:%M:%S'",
FUN=as.POSIXct )
Its giving me this error:
Error in read.zoo(d, format = "'%Y-%m-%d %H:%M:%S'", FUN = as.POSIXct) :
index has 5 bad entries at data rows: 1 2 3 4 5
I wish to get help on this problem.
Thank you for your consideration.
This works on the data in the post provided its OK to ignore the
-05at the end of each date/time. (To read from a file use something like the commented out line.)The output from the above code is:
For more info try ?read.zoo and ?read.table and also vignette(“zoo-read”). The last one is an entire document focused on giving
read.zooexamples.EDIT: Added links to commentary.