Add new country in the inst/extdata/db/ folder

add_iso(x, iso, ds, level, map = c("id"), append = TRUE)

Arguments

x

data.frame generated by a data source function.

iso

ISO code (3 letters).

ds

name of the data source function generating x.

level

integer. Granularity level. 1: country-level data. 2: state-level data. 3: city-level data.

map

named vector mapping the columns of x to the columns of the XXX.csv file.

append

logical. Append the data to the XXX.csv file if it already exists? Default TRUE.

Value

data.frame

Examples

if (FALSE) { # download data x <- COVID19:::jhucsse_git(file = "US", cache = TRUE, level = 3, country = "USA") # add iso csv <- add_iso(x, iso = "USA", ds = "jhucsse_git", level = 3, map = c( "id" = "id", "state" = "administrative_area_level_2", "city" = "administrative_area_level_3", "pop" = "population", "lat" = "latitude", "lng" = "longitude", "fips" = "key_numeric")) }