checkNamesWR {mapping} | R Documentation |
Check World country names
Description
Check the differences between the names (or codes) given in input and the names (or codes) of the worldwide countries.
Usage
checkNamesWR(id,
unit = c("country", "nato", "ocde",
"continent", "region", "subregion",
"region_wb", "type_income", "type_economy"),
matchWith = c("country", "iso2", "iso3", "iso3_eh",
"iso3_numeric", "iso3_un", "iso2_wb",
"iso3_wb", "name_formal", "name_wb"),
res = c("low", "hi"), return_logical = FALSE,
print = TRUE, use_internet = TRUE)
Arguments
id |
character vector with names or codes | ||||||||||||||||||||
unit |
the type of world statistical unit | ||||||||||||||||||||
matchWith |
the type of id to check:
| ||||||||||||||||||||
res |
map resolution | ||||||||||||||||||||
return_logical |
a logical value indicating whether nomatched id are returned | ||||||||||||||||||||
print |
a logical value indicating whether print the nomatched names | ||||||||||||||||||||
use_internet |
a logical value indicating wheter the coordinates are downloaded from https://github.com/mappinguniverse/geospatial. If |
Details
The function provides a check between id name in the dataset and the worldwide country names. The single unit can be coded in different ways, with names, id or iso standards.
Value
Returns a string vector with no matched names or a boolean vector indicating whether or not the id matched.
Author(s)
Alessio Serafini
See Also
checkNamesIT
, checkNamesEU
, checkNamesUS
Examples
data("popWR")
ck <- checkNamesWR(id = popWR$country, matchWith = "country")
ck
ck1 <- checkNamesWR(id = popWR$country_code, matchWith = "iso3", return_logical = TRUE)
ck1