Skip to contents

Makes a factor with a label from a vector of location codes

Makes a character from a vector of location codes

Usage

format_location_code_as_factor(
  x,
  label = NULL,
  label_if_not_unique = NULL,
  reference = csdata::nor_locations_names(),
  direction = 1
)

format_location_code_as_character(
  x,
  label = NULL,
  label_if_not_unique = NULL,
  reference = csdata::nor_locations_names(),
  direction = 1
)

Arguments

x

A vector of location codes

label

The label you want the elements in the character to have

label_if_not_unique

The label of elements that are not unique

reference

Where you get your data

direction

-1 is reverse

Value

Factor vector

Character vector