View source: R/survstat-loader.R
| get_snapshot | R Documentation |
SurvStat web service relating to a single time period.This function gets a snapshot of disease count or incidence data
from the Robert Koch Institute SurvStat web service, based on either whole
epidemiological season or an individual week within a season. Seasons are
whole years starting either at the beginning of the calendar year, at week 27
or at week 40.
get_snapshot(
disease = NULL,
measure = c("Count", "Incidence"),
...,
season,
season_week = NULL,
season_start = 1,
age_group = NULL,
age_range = c(0, Inf),
disease_subtype = FALSE,
geography = NULL,
.progress = TRUE
)
disease |
the disease of interest as a |
measure |
one of |
... |
not used, must be empty. |
season |
the start year of the season in which the snapshot is taken |
season_week |
the start week within the season of the snapshot. If missing then the whole season is used |
season_start |
the week of the calendar year in which the season starts
this can be one of |
age_group |
(optional) the age group of interest as a |
age_range |
(optional) a length 2 vector with the minimum and maximum ages to consider |
disease_subtype |
if |
geography |
(optional) a geographical breakdown. This can be given as a
character where it must be one of |
.progress |
by default a progress bar is shown, which may be important
if many downloads are needed to fulfil the request. It can be disabled
by setting this to |
The snapshot can be stratified by any combination of age, geography, disease,
disease subtype. Queries to SurvStat are cached and paged, but obviously
multidimensional extracts have the potential to need a lot of downloading.
a data frame with at least year (the start of the epidemiological
season) and start_week (the calendar week in which the epidemiological
season starts), and one of count or incidence columns. Most likely it
will also have disease_name and disease_code columns, and some of
age_name, age_code, age_low, age_high, geo_code, geo_name,
disease_subtype_code, disease_subtype_name depending on options.
get_snapshot(
diseases$`COVID-19`,
measure = "Count",
season = 2024,
age_group = age_groups$children_coarse
)
get_snapshot(
diseases$`COVID-19`,
measure = "Count",
age_group = age_groups$children_coarse,
season = 2024,
geography = rsurvstat::FedStateKey71Map[1:10,]
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.