nflverse / nflreadr

Efficiently download nflverse data
https://nflreadr.nflverse.com/
Other
61 stars 12 forks source link

use data.table::fifelse and call it a day #214

Closed mrcaseb closed 1 year ago

mrcaseb commented 1 year ago

fixes #213

`%c%` <- nflreadr:::`%c%`
d1 <- lubridate::as_date(c("1998-05-01",
                           "1997-12-12",
                           NA_character_))
d2 <- lubridate::as_date(c("1995-01-31",
                           NA_character_,
                           "1997-12-12"))
d1 %c% d2
#> [1] "1998-05-01" "1997-12-12" "1997-12-12"

d3 <- as.Date(c("1998-05-01",
                "1997-12-12",
                NA_character_))
d4 <- as.Date(c("1995-01-31",
                NA_character_,
                "1997-12-12"))
d3 %c% d4
#> [1] "1998-05-01" "1997-12-12" "1997-12-12"
mrcaseb commented 1 year ago

various tests failing because we are in September without an NFL game being played yet

tanho63 commented 1 year ago

Will wait on whether the CRAN submission succeeds or fails before merging, currently in limbo.

tanho63 commented 1 year ago

also just broadly laughing that my mind went to vctrs first instead of checking the datatable ifelse first lol