Skip to contents

Epidemic Curves

Functions for creating and styling epidemic curves

geom_epicurve() stat_bin_date() stat_date_count() geom_epicurve_text() geom_epicurve_point()
Create an epidemic curve plot or bin/count observations by date periods
scale_y_cases_5er() scale_x_cases_5er()
Continuous x-axis and y-axis scale for (case) counts
geom_vline_year() geom_hline_year()
Automatically create lines at the turn of every year
label_date() label_date_short()
Date labeller
guide_axis_nested_date()
Nested axis guide for date scales

Diverging Bar Charts and Diverging Area Charts

Functions for diverging plots for population pyramids, likert scales, etc.

geom_bar_diverging() geom_area_diverging() stat_diverging()
Create diverging bar charts, diverging area charts or other plots for opposing categorical data.
scale_x_continuous_diverging() scale_y_continuous_diverging()
Diverging continuous scales for diverging bar charts with symmetrical limits
scale_y_discrete_reverse() scale_x_discrete_reverse()
Reversed discrete scale for 'ggplot2'

Date Binning and Seasonal Datr Alignment

Functions for binning cases by date intervalls and aligning and comparing data across seasons

bin_by_date()
Aggregate data by time periods
align_dates_seasonal() align_and_bin_dates_seasonal()
Align dates for seasonal comparison

EpiGantt Charts

Functions for EpiGantt Charts

geom_epigantt()
Epi Gantt Chart: Visualize Epidemiological Time Intervals
scale_y_discrete_reverse() scale_x_discrete_reverse()
Reversed discrete scale for 'ggplot2'

Data Manipulation Helpers

Various functions helper functions for common epi tasks

create_agegroups()
Create Age Groups from Numeric Values
geometric_mean()
Compute a Geometric Mean
uncount() expand_counts()
Duplicate rows according to a weighting variable

Datasets

Included datasets for examples and demonstrations

influenza_germany
German Influenza (FLU) Surveillance data
linelist_hospital_outbreak
Line list of a fictional hospital outbreak (Data)
population_german_states
Population of the German states (2023)

ggplot2 Layers and Functions

Geoms and Stats

Geoms and Stats in this package

geom_bar_diverging() geom_area_diverging() stat_diverging()
Create diverging bar charts, diverging area charts or other plots for opposing categorical data.
geom_col_range()
Create a ranged bar chart
geom_epicurve() stat_bin_date() stat_date_count() geom_epicurve_text() geom_epicurve_point()
Create an epidemic curve plot or bin/count observations by date periods
geom_epigantt()
Epi Gantt Chart: Visualize Epidemiological Time Intervals
geom_vline_year() geom_hline_year()
Automatically create lines at the turn of every year
stat_last_value() geom_label_last_value() geom_text_last_value() geom_label_last_value_repel() geom_text_last_value_repel()
Add labels or points to the last value of a line chart

Scales and Guides

ggplot2 scales and guides in this package

scale_x_continuous_diverging() scale_y_continuous_diverging()
Diverging continuous scales for diverging bar charts with symmetrical limits
scale_y_cases_5er() scale_x_cases_5er()
Continuous x-axis and y-axis scale for (case) counts
scale_y_discrete_reverse() scale_x_discrete_reverse()
Reversed discrete scale for 'ggplot2'
guide_axis_nested_date()
Nested axis guide for date scales

Labeling and Formatting

Functions for formatting labels and annotations

label_date() label_date_short()
Date labeller
label_skip()
Skip labels on an axis
label_power10()
Format numbers as power-of-10 R expressions

Theming and Styling

Functions for customizing plot appearance