I have a time series dataset that looks like df below.
I got as NA in place of 1970-04-2602:00:00 0.142 even though all dataset looks like the same.
could anyone share why is it so?
How could I solve it?
Thanks
df=read.table(header = TRUE,text = "
datetime value
1970-01-0100:00:00 0
1970-01-0100:00:00 0
1970-04-2600:00:00 0.043
1970-04-2601:00:00 0.041
1970-04-2602:00:00 0.142
1970-04-2603:00:00 0.116
1970-04-2604:00:00 0.072")
df$time=as.POSIXct(df$datetime,format="%Y-%m-%d%H:%M:%S")
df$time=format(round(df$time, units="hours"), format="%Y-%m-%d %H:%M:%S")
df$time=as.POSIXct(df$time,format="%Y-%m-%d%H:%M:%S")
df=df[,-1]
table(is.na(df))
a=is.na(df$time)
which(a==TRUE)
head(df)