View source: R/consecutive_growth_warnings.R
consecutive_growth_warnings | R Documentation |
This function calculates the number of consecutive significant ("growth_warning") observations,
grouping them accordingly. The result is stored in an S3 object of class tsd_threshold
.
Uses data from a tsd_onset
object (output from seasonal_onset()
).
seasonal_onset()
has to be run with arguments;
season_start
season_end
only_current_season = FALSE
consecutive_growth_warnings(onset_output)
onset_output |
A |
An object of class tsd_growth_warning
, containing;
A tibble of processed observations, the significant_counter column specifies when a sequence of
significant observation starts and ends. The first number is how many subsequent observations will be significant.
# Generate simulated data of seasonal waves
sim_data <- generate_seasonal_data(
years = 5,
start_date = as.Date("2022-05-26"),
trend_rate = 1.002,
noise_overdispersion = 2,
relative_epidemic_concentration = 3
)
# Estimate seasonal onset
tsd_onset <- seasonal_onset(
tsd = sim_data,
family = "quasipoisson",
season_start = 21,
season_end = 20,
only_current_season = FALSE
)
# Get consecutive significant observations
consecutive_growth_warnings(tsd_onset)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.