Package: ggoutbreak 0.4.1

Robert Challen

ggoutbreak: Estimate Incidence, Proportions and Exponential Growth Rates

Simple statistical models and visualisations for calculating the incidence, proportion, exponential growth rate, and reproduction number of infectious disease case time series. This toolkit was largely developed during the COVID-19 pandemic.

Authors:Robert Challen [aut, cre, cph]

ggoutbreak_0.4.1.tar.gz
ggoutbreak_0.4.1.zip(r-4.5)ggoutbreak_0.4.1.zip(r-4.4)ggoutbreak_0.4.1.zip(r-4.3)
ggoutbreak_0.4.1.tgz(r-4.5-any)ggoutbreak_0.4.1.tgz(r-4.4-any)ggoutbreak_0.4.1.tgz(r-4.3-any)
ggoutbreak_0.4.1.tar.gz(r-4.5-noble)ggoutbreak_0.4.1.tar.gz(r-4.4-noble)
ggoutbreak_0.4.1.tgz(r-4.4-emscripten)ggoutbreak_0.4.1.tgz(r-4.3-emscripten)
ggoutbreak.pdf |ggoutbreak.html
ggoutbreak/json (API)

# Install 'ggoutbreak' in R:
install.packages('ggoutbreak', repos = c('https://ai4ci.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/ai4ci/ggoutbreak/issues

Pkgdown site:https://ai4ci.github.io

Datasets:

On CRAN:

4.30 score 1 stars 107 exports 93 dependencies

Last updated 13 days agofrom:496bbac7dc (on 0.4.1). Checks:1 OK, 7 NOTE. Indexed: yes.

TargetResultLatest binary
Doc / VignettesOKFeb 07 2025
R-4.5-winNOTEFeb 07 2025
R-4.5-macNOTEFeb 07 2025
R-4.5-linuxNOTEFeb 07 2025
R-4.4-winNOTEFeb 07 2025
R-4.4-macNOTEFeb 07 2025
R-4.3-winNOTEFeb 07 2025
R-4.3-macNOTEFeb 07 2025

Exports:.ts_evaluate%>%%above%as.time_periodbreaks_log1pcfg_beta_prob_rngcfg_gamma_ip_fncfg_ip_sampler_rngcfg_linear_fncfg_step_fncfg_transition_fncfg_weekly_gamma_rngcfg_weekly_ip_fncfg_weekly_proportion_rngcut_datedate_seqdate_to_timedbeta2dgamma2dlnorm2dnbinom2doubling_timedwedgefdmyformat_ipgeom_eventsinfer_populationinfer_prevalenceinfer_rate_ratioinfer_risk_ratiointeger_breaksinv_wallinga_lipsitchis.Dateis.time_periodlogit_transmake_empirical_ipmake_gamma_ipmake_posterior_ipmake_resampled_ipmax_datemin_datemultinomial_nnet_modelnormalise_countnormalise_incidencepbeta2pgamma2plnorm2plot_casesplot_countsplot_growth_phaseplot_growth_rateplot_incidenceplot_ipplot_multinomialplot_prevalenceplot_proportionplot_proportionsplot_rtpnbinom2poisson_glm_modelpoisson_locfit_modelproportion_glm_modelproportion_locfit_modelpwedgeqbeta2qgamma2qlnorm2qnbinom2quantify_lagqwedgerbernrbeta2rcategoricalrdiscgammareband_discreterescale_modelrgamma2rlnorm2rnbinom2rt_corirt_epiestimrt_from_growth_ratert_from_incidencert_from_renewalrwedgescale_y_log1pscale_y_logitscore_estimatesim_apply_ascertainmentsim_apply_delaysim_apply_delay.count_datasim_apply_delay.linelistsim_branching_processsim_convolutionsim_delaysim_delayed_observationsim_multinomialsim_poisson_modelsim_poisson_Rt_modelsim_summarise_linelistsim_test_datasummarise_iptime_aggregatetime_summarisetime_to_datetype.time_periodwallinga_lipsitch

Dependencies:aweekbackportsbrewcachemcallrcheckmateclicoarseDataToolscodacolorspacecommonmarkcpp11crayondata.tabledescdigestdplyrEpiEstimevaluatefansifarverfastmapfitdistrplusforcatsfsgenericsggplot2gluegridExtragtablehighrincidenceinterfacerisobandjsonliteknitrlabelinglatticelifecyclelobstrlocfitlubridatemagrittrMASSMatrixMatrixModelsmcmcMCMCpackmemoiseMetricsmgcvmunsellnlmennetpillarpkgbuildpkgconfigpkgloadplyrprettyunitsprocessxpspurrrquantregR6raggRColorBrewerRcppRcppArmadilloreshape2rlangroxygen2rprojrootscalesscoringRulesscoringutilsSparseMstringistringrsurvivalsystemfontstextshapingtibbletidyrtidyselecttimechangeutf8vctrsviridisLitewithrxfunxml2yaml

Data wrangling and working with ggoutbreak

Rendered fromtime-periods.Rmdusingknitr::rmarkdownon Feb 07 2025.

Last update: 2025-02-06
Started: 2023-12-24

England COVID-19 cases

Rendered fromcovid-timeseries.Rmdusingknitr::rmarkdownon Feb 07 2025.

Last update: 2025-02-06
Started: 2023-12-24

Estimating the reproduction number from modelled incidence

Rendered fromrt-from-incidence.Rmdusingknitr::rmarkdownon Feb 07 2025.

Last update: 2025-02-06
Started: 2024-01-05

Estimating the reproduction number from weekly data

Rendered fromtime-units.Rmdusingknitr::rmarkdownon Feb 07 2025.

Last update: 2025-02-06
Started: 2025-02-03

Infectivity profile discretisation

Rendered frominfectivity-profile-discretisation.Rmdusingknitr::rmarkdownon Feb 07 2025.

Last update: 2025-02-06
Started: 2025-02-03

Multinomial proportions models for genomic variants

Rendered fromvariant-proportions.Rmdusingknitr::rmarkdownon Feb 07 2025.

Last update: 2025-02-06
Started: 2022-10-23

Population comparisons and incidence

Rendered fromincidence-trends.Rmdusingknitr::rmarkdownon Feb 07 2025.

Last update: 2025-02-06
Started: 2023-12-24

Sampling the infectivity profile from published serial interval estimates

Rendered fromsampling-serial-interval.Rmdusingknitr::rmarkdownon Feb 07 2025.

Last update: 2025-02-06
Started: 2025-02-03

Simulation tests for growth rate estimators

Rendered fromestimators-example.Rmdusingknitr::rmarkdownon Feb 07 2025.

Last update: 2025-02-06
Started: 2022-10-23

Simulations and test harnesses

Rendered fromsimulation-test-models.Rmdusingknitr::rmarkdownon Feb 07 2025.

Last update: 2025-02-06
Started: 2025-02-03

Readme and manuals

Help Manual

Help pageTopics
Insert a layer at the bottom of a 'ggplot'%above%
Convert time period to datesas.Date.time_period as.POSIXct.time_period
Convert to a time period classas.time_period c.time_period is.time_period print.time_period seq.time_period [.time_period [<-.time_period [[.time_period [[<-.time_period
A scales breaks generator for log1p scalesbreaks_log1p
Generate a random probability based on features of the simulationcfg_beta_prob_rng
Get a IP generating function from time varying mean and SD of a gamma functioncfg_gamma_ip_fn
Randomly sample from an empirical distributioncfg_ip_sampler_rng
Linear function from dataframecfg_linear_fn
Step function from dataframecfg_step_fn
Sample from a multinomial transition matrixcfg_transition_fn
Weekly delay function with day of week effectcfg_weekly_gamma_rng
Weekly convolution distribution functioncfg_weekly_ip_fn
Random probability function with day of week effectcfg_weekly_proportion_rng
A COVID-19 infectivity profile based on an empirical resampling approachcovid_ip
Test sensitivity of PCR testscovid_test_sensitivity
The COVID-19 viral shedding durationcovid_viral_shedding
Places a set of dates within a regular time seriescut_date
Create the full sequence of values in a vectordate_seq
Expand a date vector to the full range of possible datesdate_seq.Date
Create the full sequence of values in a vectordate_seq.numeric
Expand a 'time_period' vector to the full range of possible timesdate_seq.time_period
Convert a set of dates to numeric timepointsdate_to_time
The Beta Distributiondbeta2
The Gamma Distributiondgamma2
The Log Normal Distributiondlnorm2
The Negative Binomial Distributiondnbinom2
Doubling time from growth ratedoubling_time
The Du empirical serial interval datasetdu_serial_interval_ip
Wedge distributiondwedge
The SPI-M-O England consensus growth rateengland_consensus_growth_rate
The SPI-M-O England consensus reproduction numberengland_consensus_rt
Daily COVID-19 case counts by age group in Englandengland_covid
England COVID-19 PCR test positivityengland_covid_pcr_positivity
England COVID by age group for ascertainmentengland_covid_proportion
England demographicsengland_demographics
Key dated in the COVID-19 response in Englandengland_events
NHS COVID-19 app dataengland_nhs_app
The england_ons_infection_survey datasetengland_ons_infection_survey
Counts of COVID-19 variantsengland_variants
Format date as dmyfdmy
Print a summary of an infectivity profileformat_ip
A COVID-19 infectivity profile based on an Ganyani et al 2020ganyani_ip
A COVID-19 infectivity profile based on an Ganyani et al 2020ganyani_ip_2
Add time series event markers to a time series plot.geom_events
Weekly COVID-19 case counts by age group in Germanygermany_covid
Germany demographicsgermany_demographics
Infers a daily baseline population for a timeseriesinfer_population
Infer the prevalence of disease from incidence estimates and population size.infer_prevalence
Calculate a risk ratio from incidence (experimental)infer_rate_ratio
Calculate a normalised risk ratio from proportionsinfer_risk_ratio
Strictly integer breaks for continuous scaleinteger_breaks
Calculate a growth rate from a reproduction number and an infectivity profileinv_wallinga_lipsitch
Check whether vector is a dateis.Date
Extract Parts of a POSIXt or Date Objectjulian.time_period
Label a time periodlabels.time_period
logit scalelogit_trans
Recover a long format infectivity profile from an 'EpiEstim' style matrixmake_empirical_ip
Make an infectivity profile from published datamake_gamma_ip
Make an infectivity profile from posterior samplesmake_posterior_ip
Re-sample an empirical IP distribution direct from datamake_resampled_ip
The maximum of a set of datesmax_date
The minimum of a set of datesmin_date
Extract Parts of a POSIXt or Date Objectmonths.time_period
Multinomial time-series model.multinomial_nnet_model
Calculate a normalised count per capitanormalise_count
Calculate a normalised incidence rate per capitanormalise_incidence
The Beta Distributionpbeta2
The Gamma Distributionpgamma2
The Log Normal Distributionplnorm2
Plot a raw case counts as a histogramplot_cases
Plot a raw case count timeseriesplot_counts
Plot an incidence or proportion versus growth phase diagramplot_growth_phase
Growth rate timeseries diagramplot_growth_rate
Plot an incidence timeseriesplot_incidence
Plot an infectivity profileplot_ip
Plot a multinomial proportions modeplot_multinomial
Plot a proportions timeseriesplot_prevalence
Plot a proportions timeseriesplot_proportion
Plot a raw case count proportion timeseriesplot_proportions
Reproduction number timeseries diagramplot_rt
The Negative Binomial Distributionpnbinom2
Poisson time-series model.poisson_glm_model
Poisson time-series model.poisson_locfit_model
Binomial time-series model.proportion_glm_model
A binomial proportion estimate and associated exponential growth rateproportion_locfit_model
Wedge distributionpwedge
The Beta Distributionqbeta2
The Gamma Distributionqgamma2
The Log Normal Distributionqlnorm2
The Negative Binomial Distributionqnbinom2
Identify estimate lags in a modelquantify_lag
Extract Parts of a POSIXt or Date Objectquarters.time_period
Wedge distributionqwedge
A random Bernoulli sample as a logical valuerbern
The Beta Distributionrbeta2
Sampling from the multinomial equivalent of the Bernoulli distributionrcategorical
Random count data from a discrete gamma distributionrdiscgamma
Reband any discrete distributionreband_discrete
Re-parametrised distributionsreparam-dist
Rescale a timeseries in the temporal dimensionrescale_model
The Gamma Distributionrgamma2
The Log Normal Distributionrlnorm2
The Negative Binomial Distributionrnbinom2
Reproduction number estimate using the Cori methodrt_cori
'EpiEstim' reproduction numberrt_epiestim
Wallinga-Lipsitch reproduction number from growth ratesrt_from_growth_rate
Reproduction number from modelled incidencert_from_incidence
Reproduction number from renewal equation applied to modelled incidence using statistical re-samplingrt_from_renewal
Wedge distributionrwedge
A log1p y scalescale_y_log1p
A logit y scalescale_y_logit
Calculate scoring statistics from predictions using 'scoringutils'.score_estimate
Apply a ascertainment bias to the observed case counts.sim_apply_ascertainment
Apply delay distribution to count or linelist datasim_apply_delay
Generate a line list from a branching process model parametrised by reproduction numbersim_branching_process
Apply a time varying probability and convolution to count datasim_convolution
Apply a time-varying probability and delay function to linelist datasim_delay
Apply a right censoring to count data.sim_delayed_observation
Generate a multinomial outbreak defined by per class growth rates and a poisson modelsim_multinomial
Generate an outbreak case count series defined by growth rates using a poisson model.sim_poisson_model
Generate an outbreak case count series defined by Reproduction number using a poisson model.sim_poisson_Rt_model
Summarise a line listsim_summarise_linelist
Generate a simple time-series of cases based on a growth rate step functionsim_test_data
Generate a single infectivity profile from multiple bootstrapssummarise_ip
An example of the linelist output of the branching process model simulationtest_bpm
A test infectivity profile generated from a set of discretised gamma distributions with parameters mean 5 (95% CI 4-6) and sd 2 (95% CI 1.5-2.5).test_ip
An example of the linelist output of the poisson model simulation with defined $R_t$test_poisson_rt
A serial interval estimated from simulated datatest_serial
A test time series datasettest_ts
Aggregate time series data preserving the time seriestime_aggregate
Summarise data from a line list to a time-series of counts.time_summarise
Convert a set of time points to datestime_to_date
Calculate the reproduction number from a growth rate estimate and an infectivity profilewallinga_lipsitch
Wedge distributionwedge
Extract Parts of a POSIXt or Date Objectweekdays.time_period