Learn R Programming

phscs (version 0.1.0)

shorten_region_name: Shorten region name

Description

This function shortens the region names in a PSGC data frame.

Usage

shorten_region_name(data, which = c("label", "number"), col = "area_name")

Value

A data frame with the region names shortened based on the specified which argument.

Arguments

data

A data frame containing PSGC data.

which

Character. Specifies whether to shorten the region name by label or number. Options are "label" or "number".

col

Character. The name of the column containing the area names. Default is "area_name".

Examples

Run this code
regions <- get_psgc(level = "regions")
shorten_region_name(regions)
shorten_region_name(regions, which = "number")

Run the code above in your browser using DataLab