A function to retrieve a dataframe (df) with combined Case/Death/Vaccine data by country
Source:R/get_combined_table.R
get_combined_table.Rd
A function to retrieve a dataframe (df) with combined Case/Death/Vaccine data by country
Usage
get_combined_table(type = c("WHO", "Both", "legacy"), geometry = FALSE)
Arguments
- type
(character) Specifies what data streams to include for case/death data. See details for further information
- geometry
(logical, default: FALSE) Specifies whether df should include the geometry column
Details
The type
argument used to take two values: "WHO" and "Both", referring to whether to take WHO data as-is, or to supplement WHO data with disaggregated China data from JHU.
In early Jan 2023, China CDC ceased providing daily COVID-19 updates, so the Mainland China data provided by JHU also stopped. On Mar 10, 2023 JHU closed their dashboard entirely,
so new sources had to be located for HK, Macau, and Taiwan data.
For legacy analyses, the old behavior for "Both" is now available as "legacy"
The new "Both" type pulls data from HK CHP, Taiwan CDC, and JHU (for Macau data thru Mar 10) in addition to the China data in WHO (which also includes Taiwan, HK, and Macau data). Because data from HK and Taiwan are duplicated in this way, you should not use data from the "Both" option to compute regional or global trends.
See also
get_covid_df()
, get_vax()
, and calc_add_risk()
for full column data documentation
Examples
if (FALSE) {
# Get the df that combines China with Taiwan, Hong Kong, and Macau data
df_who <- get_combined_table("WHO")
print(df_who)
# Get the df that combines WHO China data (aggregated) with disggregated entries for HK, Taiwan, and Macau (from JHU thru Mar 10, 2023)
df_both <- get_combined_table("Both")
print(df_both)
# Get the df that uses both disaggregated China, Taiwan, Hong Kong, and Macau data (WHO + JHU = "legacy")
# (JHU sunset on Mar 10, 2023 and China mainland data ceased earlier in the year)
df_both <- get_combined_table("legacy")
print(df_both)
}