getAgeGender: Get disease-specific age and gender bar graph

Description Usage Arguments Value See Also Examples

View source: R/AER_age_gender_bar.R

Description

Function returning the age and gender bar graph that will be included in the epidemiological report at the bookmark location 'BARGPH_AGEGENDER' of the template report.
The bar graph presents the distribution of cases at EU/EEA level using either:

The choice of the type of bar graph is set in the report parameters table AERparams.
(see ECDC reports https://www.ecdc.europa.eu/en/annual-epidemiological-reports)

Usage

1
2
3
4
5
6
7
8
9
getAgeGender(
  x = EpiReport::DENGUE2019,
  disease = "DENGUE",
  year = 2019,
  reportParameters = EpiReport::AERparams,
  geoCode = "EU_EEA31",
  index = 1,
  doc
)

Arguments

x

dataframe, raw disease-specific dataset (see specification of the dataset in the package vignette with browseVignettes(package = "EpiReport")) (default DENGUE2019)

disease

character string, disease code (default "DENGUE"). Please make sure the disease code is included in the disease-specific dataset x in the HealthTopicCode variable.

year

numeric, year to produce the graph for (default 2019). Please make sure the year is included in the disease-specific dataset x in the TimeCode variable.

reportParameters

dataframe, dataset including the required parameters for the graph and report production (default AERparams) (see specification of the dataset in the package vignette with browseVignettes(package = "EpiReport"))

geoCode

character string, GeoCode to run the analysis on (default "EU_EEA31")

index

integer, figure number

doc

'Word' document (see 'officer' package) in which to add the graph at the bookmark location. If doc is missing, getAgeGender returns the ggplot2 object.

Value

'Word' doc or a ggplot2 object

See Also

Global function for the full epidemilogical report: getAER
Required Packages: ggplot2 officer
Internal functions: plotBarGrouped (use of plotAgeGender discouraged) plotBar (use of plotAge discouraged) EcdcColors
Default datasets: AERparams

Examples

1
2
3
4
5
6
# --- Plot using the default dataset
getAgeGender()

# --- Plot using external dataset
# --- Please see examples in the vignette
browseVignettes(package = "EpiReport")

EU-ECDC/EpiReport documentation built on Feb. 11, 2021, 6:30 p.m.