jhu_data_to_excel: Create +/- write excel format of enriched JHU global data

Description Usage Arguments Value Note Examples

View source: R/jhu_to_excel.R

Description

The purpose of this function is to enrich the JHU dataset with additional country-level metadata and then get the data into a form that can be easily written to excel or used as a "wide-format" tabular dataset.

Usage

1
2
3
4
5
6
7
jhu_data_to_excel(
  dat = jhu_data(),
  file = NA,
  cols_to_remove = c("callingCodes", "altSpellings", "latlng", "demonym", "timezones",
    "nativeName", "currencies", "languages", "translations", "flag", "regionalBlocs"),
  ...
)

Arguments

dat

a data.frame-like object with at least column CountryRegion that will be joined with country data.

file

character(1) filename to which to save excel file. If specified, use the write.xlsx() function from the openxlsx package to create (or overwrite) the file of that name. The excel file will have one tab for each of the subset records from the supplied data.frame in dat.

cols_to_remove

a character vector of column names from country_metadata() to remove.

Value

A list of three data.frames named deaths, confirmed, and recovered.

Note

This function is really a utility function to provide an excel format of data to folks more familiar with excel than with R.

Examples

1
2
3
xls_form = jhu_data_to_excel()
names(xls_form)
head(xls_form[[1]])

vjcitn/sars2app documentation built on Jan. 3, 2022, 12:19 a.m.