df <- data.frame(
datum = seq.Date(from = as.Date("2024-01-01"), by = "day", length.out = 400),
neue_faelle = rpois(400, lambda = 20)
)
res_day <- compare_monthly_cases(
df = df,
datum_col = "datum",
value_col = "neue_faelle",
years = c(2024,2025),
months = 1:2,
granularity = "day",
shift_month = "none",
agg_fun = "sum",
save_plot = FALSE
)
res_week <- compare_monthly_cases(
df = df,
datum_col = "datum",
value_col = "neue_faelle",
years = c(2024,2025),
months = 1:2,
granularity = "week",
shift_month = "none",
agg_fun = "sum",
save_plot = FALSE
)
compare_distribution_by_granularity(res_day, res_week)
Run the code above in your browser using DataLab