what am I doing wrong??
I use
dates<- strptime(dataframe$Measurement.Time,"%d.%m.%Y %H:%M",tz="")
to convert the character strings into dates. This works perfectly on 14780 observations. But in two cases it returns NA
.
This is an example where it worked. The excerpts are both from the same resulting data frame.
head(dataframe.with.dates)
date.time Measurement.Time mü.mü.VWC.1 øC.Temp.1
1 2000-01-10 00:30:00 10.01.2000 0:30 -0.011 -0.6
2 2000-01-10 01:00:00 10.01.2000 1:00 -0.011 -0.6
3 2000-01-10 01:30:00 10.01.2000 1:30 -0.011 -0.6
This is an excerpt of my resulting data frame showing the two results where it went wrong:
subset(dataframe.with.dates,is.na(dataframe.with.dates$date.time))
date.time Measurement.Time mü.mü.VWC øC.Temp
9572 <NA> 29.03.2015 2:00 -0.011 -0.6
9573 <NA> 29.03.2015 2:30 -0.011 -0.6
where "date.time" is in POSIXlt
and "Measurement.time" is the original date in character
.
I have checked the original .txt file where I got the data from but could not find any difference to the measurements above and below.