Summarise a dataframe containing draws of reporting squares
Source:R/aggregate_df_by_ref_time.R
aggregate_df_by_ref_time.Rd
This function ingests a long tidy dataframe containing many draws of
reporting squares across each reference time, by summing over all the
counts reported at each delay d
.
Value
summary_df
Dataframe containing the nowcasted expected observed
total observations at each reference time.
Examples
nowcast_draws_df <- data.frame(
time = c(1, 1, 1, 1, 2, 2, 2, 2),
delay = c(1, 2, 1, 2, 1, 2, 1, 2),
draw = c(1, 1, 2, 2, 1, 1, 2, 2),
count = c(3, 6, 4, 7, 1, 2, 2, 3)
)
summary_df <- aggregate_df_by_ref_time(nowcast_draws_df)
print(summary_df)
#> time draw total_count
#> 1 1 1 9
#> 2 2 1 3
#> 3 1 2 11
#> 4 2 2 5