powered by
This function shortens the region names in a PSGC data frame.
shorten_region_name(data, which = c("label", "number"), col = "area_name")
A data frame with the region names shortened based on the specified which argument.
which
A data frame containing PSGC data.
Character. Specifies whether to shorten the region name by label or number. Options are "label" or "number".
"label"
"number"
Character. The name of the column containing the area names. Default is "area_name".
"area_name"
regions <- get_psgc(level = "regions") shorten_region_name(regions) shorten_region_name(regions, which = "number")
Run the code above in your browser using DataLab