I ran into a problem when using as_datetime in combination with dplyr::mutate. The latter doesn't accept POSIXlt which was being returned by as_datetime. However looking into the documentation there is no mention of POSIXlt. The documentation states: "These are drop in replacements for as.Date() and as.POSIXct()".
So is the documentation incomplete or should the function be changed?
Example:
library(lubridate)
class(as_datetime("2018-09-05 09:41:31", format="%Y-%m-%d %H:%M:%S"))
[1] "POSIXlt" "POSIXt"
I ran into a problem when using
as_datetimein combination withdplyr::mutate. The latter doesn't acceptPOSIXltwhich was being returned byas_datetime. However looking into the documentation there is no mention ofPOSIXlt. The documentation states: "These are drop in replacements for as.Date() and as.POSIXct()".So is the documentation incomplete or should the function be changed?
Example:
library(lubridate)class(as_datetime("2018-09-05 09:41:31", format="%Y-%m-%d %H:%M:%S"))[1] "POSIXlt" "POSIXt"