clean_countries: Clean Natural Earth Country names to match PEPFAR Data

View source: R/clean.R

clean_countriesR Documentation

Clean Natural Earth Country names to match PEPFAR Data

Description

‘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.

Usage

clean_countries(.data, colname = "admin", language = "en", short = TRUE)

Arguments

.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

Value

Cleaned DataFrame

Examples

## 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)


USAID-OHA-SI/glamr documentation built on July 6, 2024, 6:39 a.m.