Open francisbarton opened 1 year ago
will have a look at this.
including {lubridate}
would be a last resort - it's only needed in one place, and including an extra dependency has issues (it's advised you stay below something like 20 dependencies when submitting to CRAN)
There's a strange error in one of the tests.
If you look at /tests/testthat/test-ptd_create_ggplot.R#L109
The tests below this one use
as.Date()
, which works fine. Do we want a date, or a datetime? I can't see why theto_datetime.character
Method wouldn't work on "2020-01-01". It should just callas.POSIXct()
.Could we just use
lubridate::as_datetime()
throughout the package, instead of the internalto_datetime()
? I think that function will handle the different cases thatto_datetime()
tries to handle - but perhaps there is a nuance here about exactly what the output needs to be. (I haven't gone into learning the differences between POSIXt and POSIXct!)[
lubridate
is now in the core tidyverse so it doesn't feel too unreasonable to add it as a dependency, given we already have dplyr and stringr and ggplot2 of course.]Does this particular test need
to_datetime
, or wouldas.Date()
orlubridate::as_date/as_datetime
work just as well? For now I am just going to edit the test to useas.Date()
instead.Here's a very simple reprex:
@tomjemmett
Related: #169 ?