cumulative_count_covid19_incident: Return the cumulative count of COVID-19 incident per case...

Description Usage Arguments Value Examples

View source: R/cumulative_count_covid19_incident.R

Description

Return the cumulative count of COVID-19 incident per case category for the given the geographical names (i.e., zip codes, state codes, state names, county names) and the observation date period.

Usage

1
2
3
4
5
6
7
cumulative_count_covid19_incident(
  geo_names,
  location_type = c(NA, "zip", "county", "state"),
  start_date = "2020-01-01",
  end_date = "2020-03-31",
  date = NA
)

Arguments

geo_names

required, vector of string(s) of geographical names.

location_type

optional, string indicating the location type of the geographical names. NA by default.

start_date

optional, date indicating the start date of observation. "2020-01-01" by default.

end_date

optional, date indicating the end date of observation. "2020-03-31" by default.

date

optional, date indicating a single date of observation. This parameter overrides the start_date and end_date parameters when it is not NA, such that start_date=date and end_date=date. NA by default.

Value

A named list with each list item is a data frame containing the cumulative count observations of COVID-19 incident per case category. The data frame is identified by the observation date.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
states <- c("Alabama","California","New York","Pennsylvania","Washington")

# Count the cumulative count of COVID-19 incidents in the specified states
cumulative_count_covid19_incident(states)

# Count the cumulative count of COVID-19 incidents from mid-June until today
cumulative_count_covid19_incident(states, start_date="2020-06-30", end_date=Sys.Date())

# Count the cumulative count of COVID-19 incidents 10 days ago from today
cumulative_count_covid19_incident(states, date=Sys.Date()-10)

johardi/commondata-r documentation built on July 7, 2021, 11:24 p.m.