is_region_name: Check if string is region name

View source: R/test_region_classifications.R

is_region_nameR Documentation

Check if string is region name

Description

By default, the tests whether input is a name in standard form. Non-standard forms can be tested by setting allow_nonstandard_names = TRUE.

Usage

is_region_name(
  x,
  region_level = NULL,
  year = NULL,
  offline = TRUE,
  allow_nonstandard_names = FALSE,
  case_sensitive = TRUE,
  lang = "fi"
)

Arguments

x

character, a vector of potential region names.

region_level

character, optional region level of the input region codes. Possible region_levels are statficlassifications:::prefix_name_key$name.

year

double, year of region classification searched.

offline

logical, whether works offline with package data. Defaults to TRUE.

allow_nonstandard_names

logical, whether to accept a broader set of names as region names.

case_sensitive

logical, whether recognition is case sensitive, defaults to FALSE.

lang

"fi", "sv" or "en". Language of the input name. Defaults to "fi".

Details

Region variable detection functions use the testing functions here.

Value

logical

Examples


 is_region_name(c("Kainuu", "Kainuun maakunta", "Kajjjaani"))
 is_region_name(c("Kainuu", "Kainuun maakunta", "Kajjjaani"), allow_nonstandard_names = TRUE)



pttry/statficlassifications documentation built on Jan. 17, 2024, 4:36 p.m.