I am having a problem with date & time format in R.
My R code is having the format: "%Y%m%d %H%M%OS". For example: "20170929 20:59:56.149"
Time in my case is character variable.
I am trying to write a R code where type of format will be converted into the format "%Y-%m-%d %H:%M:%OS"
(data <- strptime(data$time,
format = "%Y-%m-%d %H:%M:%OS",
tz = "GMT"))
or for example
data$time <- as.POSIXct(data$time, format = "%Y-%m-%d %H:%M:%OS")
But, I am getting NA. What could this be caused by? Do you have any idea how to fix it? Thank you in advance for your help!