Closed mitchellmanware closed 4 months ago
@mitchellmanware I wasn't necessarily saying we have to use to lubridate
but to look at that package for the best standards and flexibility for time in R. lubridate
very well may be that, but I'm not sure.
I will have to compare its functions with base R's series of as.POSIXct
functions, as I know the latter can be used for dates and dates + hours minutes and seconds but I do not know how they handle years or months.
It might also be helpful for the models themselves as lubridate
is a tidyverse package.
I agree lubridate
is very convenient with neat syntax to accommodate generic strings and tidy datetime class. If we agree on adding dependency, it will work per se, but one thing I want to note is that POSIXct
and POSIXlt
(more human-readable kind of POSIXct
) with combination of strftime
works pretty well in performance comparable to lubridate
. As a side note, terra::time()
returns values in POSIXct
class.
Check for and coercion to POSIXt
format is implemented. Format is preferred to lubridate
for using base R functionality when possible.
https://rawgit.com/rstudio/cheatsheets/main/lubridate.pdf