Closed avallecam closed 1 month ago
Cheers for the report @avallecam. This should now be fixed on the main branch. I'll try and get it on CRAN this evening/tomorrow. It should have been updated with the 2.3.0 release but was an oversight.
it worked, thanks!
library(dplyr)
library(incidence2)
ebola <- subset(outbreaks::ebola_sim_clean$linelist ,!is.na(hospital))
daily_incidence <- incidence(ebola, date_index = "date_of_onset")
# {incidence2} coerse output to <tibble> class (which I like)
daily_incidence %>% class()
#> [1] "incidence2" "tbl_df" "tbl" "data.frame"
# mutate() keep the <tibble> class (which I like)
daily_incidence %>% dplyr::mutate(col = "all") %>% class()
#> [1] "incidence2" "tbl_df" "tbl" "data.frame"
# [now solved] BUT select() drop the <tibble> class (which I do not like)
daily_incidence %>% dplyr::select(date_index, count) %>% class()
#> [1] "tbl_df" "tbl" "data.frame"
daily_incidence %>% incidence2::select(date_index, count) %>% class()
#> [1] "tbl_df" "tbl" "data.frame"
#
Created on 2024-10-07 with reprex v2.1.1
Is this behaviour expected? If it is, interested to read the rationale behind it. I found it while writing an assessment to connect class object only, and the class was kept.
incidence2
outputs withepinow2
. I tested this with aOne implication of this is that I add one step to convert the
incidence2
output to tibble beforeepinow2
to conserve the display features as written in https://github.com/avallecam/epicatador/blob/main/68-emcr-summative-06.R#L53-L56Please place an "x" in all the boxes that apply
Please include a brief description of the problem with a code example:
Created on 2024-10-06 with reprex v2.1.1