NIEHS / amadeus

https://niehs.github.io/amadeus/
MIT License
2 stars 2 forks source link

use `lubridate` for `$time` column in covariates data frame #74

Open mitchellmanware opened 2 months ago

mitchellmanware commented 2 months ago

https://rawgit.com/rstudio/cheatsheets/main/lubridate.pdf

kyle-messier commented 2 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.

mitchellmanware commented 2 months ago

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.

sigmafelix commented 2 months ago

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.