Skip to contents

Many regionalisations have numeric values in the shape files that correspond to a vector of names. Here we provide a function to quickly replace the numbers with names.

Usage

splnr_match_names(dat, nam)

Arguments

dat

sf data frame with one column of numeric/integer corresponding to nam

nam

Named character vector of names corresponding to column of dat to recode

Value

An sf dataframe with numeric regionalisations substituted for category names

Examples

dat <- dat_region %>% dplyr::select(-cellID)
nam <- c("Region1" = "SE Aust", "Region2" = "Tas", "Region3" = "NE Aust")
df <- splnr_match_names(dat, nam)