When I convert my time-date column (dateWw) to POSIXct (column dateW) the first 2 rows become duplicates and the odd milliseconds in my original column become even (e.g. row 3 and 4).
options(digits.secs=5)
jalpy$dateW <- as.POSIXct(jalp$dateWw, format = "%Y-%m-%d %H:%M:%OS", tz="GMT")
> head(jalpy)
dateWw dateW depth
1 2016-06-15 02:09:27.00 2016-06-15 02:09:27.00 0.0900
2 2016-06-15 02:09:27.01 2016-06-15 02:09:27.00 0.0898
3 2016-06-15 02:09:27.05 2016-06-15 02:09:27.04 0.0894
4 2016-06-15 02:09:27.09 2016-06-15 02:09:27.08 0.0890
5 2016-06-15 02:09:27.16 2016-06-15 02:09:27.16 0.0884
6 2016-06-15 02:09:27.20 2016-06-15 02:09:27.20 0.0880
> str(jalpy)
'data.frame': 872976 obs. of 3 variables:
$ dateWw: chr "2016-06-15 02:09:27.00" "2016-06-15 02:09:27.01" "2016-06-15 02:09:27.05" "2016-06-15 02:09:27.09" ...
$ dateW : POSIXct, format: "2016-06-15 02:09:27.00" "2016-06-15 02:09:27.00" "2016-06-15 02:09:27.04" ...
$ depth : num 0.09 0.0898 0.0894 0.089 0.0884 ...
>
I have tried converting my data to POSIXct from epoch time, POSIXlt and using the lubridate package but they all produce the same outcome.
Just wondering if anyone has come across this before and knows a solution?
Thanks!
Grace