get_time_series_for: Time series of COVID-19 cases and deaths

Description Usage Arguments Value Examples

View source: R/sti.R

Description

get_time_series_for() is used to create a tibble of COVID-19 cases and COVID-19 related deaths for a region and a certain age group. The time period can be defined by the user.

Usage

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

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 (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 summed cases/deaths of these regions.

from

A date that specifies the beginning of the time series

to

A date that specifies the end of the time series

Value

A tibble that contains the number of cases and deaths for the desired regions during the defined period of time. The default version without any arguments returns a tibble that contains all the cases/deaths of Germany between 2020-01-01 and today.

Examples

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

get_time_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.