I am trying to get the number of days from a specific date using difftime(). If I use the November date (10.11.14) it works fine, if I use the September date (10.09.14) it adds .0417 to the date. Any idea how I can solve this?
head(dummydat)
reihe nummer bluh_datum
1 1 1 07.03.15
2 1 2 11.03.15
3 1 3 09.03.15
4 1 4 <NA>
5 1 5 <NA>
6 1 6 07.03.15
dummydat <- cbind(dummydat,"days"=as.numeric(difftime(strptime(dummydat$bluh_datum, format="%d.%m.%y"),strptime("10.11.14", format="%d.%m.%y"), units="days")))
> head(dummydat)
reihe nummer bluh_datum days
1 1 1 07.03.15 117
2 1 2 11.03.15 121
3 1 3 09.03.15 119
4 1 4 <NA> NA
5 1 5 <NA> NA
6 1 6 07.03.15 117
> dummydat <- cbind(dummydat,"days"=as.numeric(difftime(strptime(dummydat$bluh_datum, format="%d.%m.%y"),strptime("10.09.14", format="%d.%m.%y"), units="days")))
> head(dummydat)
reihe nummer bluh_datum days days
1 1 1 07.03.15 117 178.0417
2 1 2 11.03.15 121 182.0417
3 1 3 09.03.15 119 180.0417
4 1 4 <NA> NA NA
5 1 5 <NA> NA NA
6 1 6 07.03.15 117 178.0417