Output tibble from list of unsynced module outputs, with an optional date column. The optional ref_date argument is the starting date of an input with offset 0. In general, this will be the date corresponding to the first entry in the original incidence data. If a reference date is provided with ref_date, a date column is appended to the tibble, with sequential dates generated with the time step specified by the time_step parameter.

merge_outputs(
  output_list,
  ref_date = NULL,
  time_step = "day",
  include_index = is.null(ref_date),
  index_col = "idx"
)

Arguments

output_list

named list of module output objects.

ref_date

Date. Optional. Date of the first data entry in incidence_data

time_step

string. Time between two consecutive incidence datapoints. "day", "2 days", "week", "year"... (see seq.Date for details)

include_index

boolean. Include an index column in output?

index_col

string. If include_index is TRUE, an index column named index_col is added to the output.

Value

tibble

Examples

shape_incubation = 3.2 scale_incubation = 1.3 delay_incubation <- list(name="gamma", shape = shape_incubation, scale = scale_incubation) smoothed_incidence <- smooth_incidence(HK_incidence_data$onset_incidence) deconvolved_incidence <- deconvolve_incidence( smoothed_incidence, delay = delay_incubation ) ## Basic usage of merge_outputs merged_incidence_1 <- merge_outputs( list("smoothed symptom onset" = smoothed_incidence, "deconvolved symptom onset" = deconvolved_incidence) ) ## Advanced usage of merge_outputs merged_incidence_2 <- merge_outputs( list("smoothed symptom onset" = smoothed_incidence, "deconvolved symptom onset" = deconvolved_incidence), ref_date = HK_incidence_data$date[1], include_index = TRUE, index_col = "index" )