Growth rate timeseries diagram
Arguments
- modelled
a growth rate dataframe. - EITHER: a dataframe with columns:
time (ggoutbreak::time_period + group_unique) - A (usually complete) set of singular observations per unit time as a `time_period`
growth.fit (double) - an estimate of the growth rate
growth.se.fit (positive_double) - the standard error the growth rate
growth.0.025 (double) - lower confidence limit of the growth rate
growth.0.5 (double) - median estimate of the growth rate
growth.0.975 (double) - upper confidence limit of the growth rate
Any grouping allowed.
OR with columns:
time (ggoutbreak::time_period + group_unique) - A (usually complete) set of singular observations per unit time as a `time_period`
relative.growth.fit (double) - an estimate of the relative growth rate
relative.growth.se.fit (positive_double) - the standard error the relative growth rate
relative.growth.0.025 (double) - lower confidence limit of the relative growth rate
relative.growth.0.5 (double) - median estimate of the relative growth rate
relative.growth.0.975 (double) - upper confidence limit of the relative growth rate
Any grouping allowed.
- ...
Named arguments passed on to
geom_eventseventsSignificant events or time spans - a dataframe with columns:
label (character) - the event label
start (date) - the start date, or the date of the event
end (date) - the end date or NA if a single event
Any grouping allowed.
A default value is defined.
Named arguments passed on to
geom_truthtrue_dfa data frame with a
time_periodcolumn called time and a value column (name given intrue_col). This is optional and will be picked up from therawparameter if given.true_colthe column name / expression of the true value
true_fmta list of ggplot formatting to apply to the true value timeseries
...Named arguments passed on to
as.time_periodunitthe length of one unit of time. This will be either a integer number of days, or a specification such as "1 week", or another
time_period. Ifxis atime_period, and the unit is different to that ofxthis will return a rescaledtime_periodusing the new units.start_datethe zero time date as something that can be coerced to a date. If the
xinput is already atime_periodand this is different to itsstart_datethenxwill be recalibrated to use the new start date.anchoronly relevant if
xis a vector of dates, this is a date, or"start"or"end"or a weekday name e.g."mon". With the vector of dates inxit will use this anchor to find a reference date for the time-series. If not provided then the current defaults will be used. (seeset_defaults())
- mapping
a
ggplot2::aesmapping. Most importantly setting thecolourto something if there are multiple incidence time series in the plot- events
Significant events or time spans - a dataframe with columns:
label (character) - the event label
start (date) - the start date, or the date of the event
end (date) - the end date or NA if a single event
Any grouping allowed.
A default value is defined.
Examples
data = example_poisson_rt_2class()
tmp2 = data %>% poisson_locfit_model()
if(interactive()) {
plot_growth_rate(tmp2)
}
