All table functions provide an interface to produce gt tables for CDC Reports.
These tables are computed using a standard data.frame of cases and deaths provided from get_covid_df()
or get_combined_table()
table_10mostcases
displays a table with the top-10 countries by total cases reported in the time period specifiedtable_10incidence
displays a table with the top-10 countries by average incidence in the time period specifiedtable_10percentchange
displays a table with the top-10 countries by percent change in the time period specified
Usage
table_10mostcases(df, time_step = 7, region = NULL, data_as_of = NULL)
table_10incidence(df, time_step = 7, region = NULL, data_as_of = NULL)
table_10percentchange(
df,
time_step = 7,
second_time_step = 28,
region = NULL,
data_as_of = NULL
)
Arguments
- df
A data.frame with at least the following columns: id, date, new_cases
- time_step
(numeric, default: 7) time step in days to compute values over
- region
(optional) a character string specifying a DoS or WHO region for title, or NULL if none
- data_as_of
(optional) a character string for the data-as-of date. If NULL, inferred from latest date in data.
- second_time_step
(numeric, default: 28) for table_10percentchange, time in days to compute percent change over for second column