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

View source: R/jhu_to_excel.R

jhu_data_to_excelR Documentation

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

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

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.

...

passed to write.xlsx

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

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


seandavi/sars2pack documentation built on May 13, 2022, 3:41 p.m.