R/jhu_to_excel.R
jhu_data_to_excel.Rd
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.
a data.frame-like object with at least column
CountryRegion
that will be joined with country data.
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
.
a character vector of column names from
country_metadata()
to remove.
passed to write.xlsx
A list of three data.frames
named deaths
, confirmed
,
and recovered
.
This function is really a utility function to provide an excel format of data to folks more familiar with excel than with R.
xls_form = jhu_data_to_excel()
#> Error in curl::curl_fetch_memory(url, handle = handle): Timeout was reached: [restcountries.eu] Failed to connect to restcountries.eu port 443: Connection timed out
names(xls_form)
#> Error in eval(expr, envir, enclos): object 'xls_form' not found
head(xls_form[[1]])
#> Error in head(xls_form[[1]]): object 'xls_form' not found