Learn R Programming

COVID19 (version 2.0.3)

add_iso: Add XXX.csv file

Description

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

Usage

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.

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

Run this code
# NOT RUN {
# 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"))
 
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab