get_sti_series_for: Time series of 7-day-incidence

Description Usage Arguments Value Warning Examples

View source: R/sti.R

Description

get_sti_series_for() is used to create a tibble of the 7-day-incidence of a region and a certain age group. The time period can be defined by the user.

Usage

1
2
3
4
5
6
7
get_sti_series_for(
  ages = "all",
  regions = "Germany",
  from = "2020-01-01",
  to = Sys.Date(),
  return_deaths = F
)

Arguments

ages

A vector of numbers specifying the desired age groups. The available age groups are "A00-A04","A05-A14","A15-A34","A35-A59","A60-A79" and "A80+". The numbers in ages are automatically assigned to the belonging age group and afterwards, the cases and deaths of of these age groups are added up.

regions

A vector that either consists of strings (either the names of German districts or the names of German states) or district ID's. If this vector has more than one entry, the tibble contains the 7-day-incidence of these regions together.

from

A date that specifies the beginning of the time series

to

A date that specifies the end of the time series

return_deaths

A boolean. If one sets return_deaths=T, another column is added to the tibble that contains the 7-day-death-average weighted by the population. (Basically, this is the something like a 7-day-death-incidence.)

Value

A tibble that contains the 7-day-incidence (or additionally, the 7-day-death-average) for the desired regions during the defined period of time. The default version without any arguments returns a tibble that contains the 7-day-incidence of Germany between 2020-01-01 and today.

Warning

When specifying region and agegroup, the incidence will not be accurate because there is no population data for the age groups in each district and it will be estimated by the age distribution of Germany. Therefore, it is recommended to specify only one or the other

Examples

1
2
3
4
5
6
get_sti_series_for(ages=c(3,55),regions="Sachsen",from="2021-01-05",to="2021-02-06")

get_sti_series_for(ages=32,regions=c(8221,8222))

## Not run: get_time_series_for(ages=c(12,42),from="2020-05-02",to="2020-05-01"
#"from" must always be an earlier date than "to"

slausmeister/revolution documentation built on Dec. 23, 2021, 3:24 a.m.