clean_countries | R Documentation |
‘clean_countries' is used to adjust Natural Earth country names to match PEPFAR’s Operatingunit / country. This function can also be used to shorten OU/Country names by setting the parameter short to TRUE.
clean_countries(.data, colname = "admin", language = "en", short = TRUE)
.data |
Reference Datasets |
colname |
Column name to be updated |
language |
language of reference, default is set to 'en'. Options are: 'fr', 'de', 'es', 'ar' |
short |
If TRUE, shorten OU/Country names instead, default is TRUE |
Cleaned DataFrame
## Not run:
library(sf)
library(rnaturalearth)
library(glamr)
spdf <- ne_countries(type = "sovereignty", scale = 110, returnclass = "sf") %>%
sf::st_drop_geometry() %>%
dplyr::select(sovereignt, admin, name, adm0_a3) %>%
glamr::clean_countries(colname = "admin")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.