checkNamesUS | R Documentation |
Check the differences between the names given in input and the names, as provided by United States Census of Bureau, of the corresponding USA statistical unit.
checkNamesUS(id,
unit = c("country", "region", "division", "state",
"county", "district",
"district_county", "urban_area"),
year = c("2018"), matchWith = c("name", "id", "number"),
scale = c("20", "50", "500"), return_logical = FALSE,
print = TRUE, use_internet = TRUE)
id |
character vector with names |
unit |
the type of USA statistical unit to check |
year |
year of the analysis |
matchWith |
the type of id to check if |
scale |
the scale of the map |
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 |
The function provides a check between id names in the dataset and the USA unit. unit
starts from the largest aggregate, "country", to the smallest, "district". Since unit can change over the years, the year of the data has to be provided.
The single state can be coded in different ways, with names, id or number.
Returns a string vector with nomatched names or a boolean vector indicating whether or not the id matched.
checkNamesIT
, checkNamesEU
, checkNamesWR
data("popUS")
ck <- checkNamesUS(popUS$id, unit = "state")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.