Closed CarmenTamayo closed 1 month ago
Related to this, when using incidence2 to obtain daily incidence data, the name "date" is used instead of the object "date_var" - is there a reason for this? would it be better to use the object?
I.e. here:
dat_i_day <- dat_raw %>% incidence("date", interval = 1L, counts = count_var, groups = group_var )
Is there something I'm missing @Bisaloo? Could I change this to .data[["counts"]], since it's always going to come from an incidence2 object?
Yes please, update it with "counts"
.
Related to this, when using incidence2 to obtain daily incidence data, the name "date" is used instead of the object "date_var" - is there a reason for this? would it be better to use the object?
Both options should be equivalent and there is no specific reason why one was used over the other here. Please feel free to use your favourite option and update if necessary.
On the skeleton of the transmissibility pipeline, the object
count_var
is created to represent the column of the input dataset that contains the number of cases (in this casecount_var = "n"
) Then {incidence2} is used to create another dataset (dat_i_day) with daily incidence where the argumentcount = count_var
Subsequently, the {EpiNow2} code chunk uses dat_i_day as input data for Rt estimation (both global and regional), and requires the column with cases to be named "confirmed" In the current script, this is done through:res_epinow2_group <- dat_i_day %>% dplyr::rename(
confirm = .data[[count_var]],date = date_index, region = .data[[group_var]] )
However, the count variable is no longer named "n" but "count", which results in an error when renamingIs there something I'm missing @Bisaloo? Could I change this to
.data[["counts"]]
, since it's always going to come from an incidence2 object?