# Create a tibble object from sample data
tsd_data <- to_time_series(
cases = c(100, 120, 150, 180, 220, 270),
time = seq(from = as.Date("2023-01-01"), by = "1 week", length.out = 6)
)
# Estimate seasonal onset with a 3-day window
seasonal_onset(
tsd = tsd_data,
k = 3,
level = 0.975,
disease_threshold = 5,
na_fraction_allowed = 0.4,
season_start = 21,
season_end = 20,
only_current_season = FALSE
)
Run the code above in your browser using DataLab