normalize_language: Normalize Language

View source: R/helpers.R

normalize_languageR Documentation

Normalize Language

Description

Returns the highest level ISO or Wikipedia language code corresponding to the ISO or Wikipedia language code, language name, or autonym provided. If the input matches zero or multiple entries, the input is returned and a warning is raised.

Usage

normalize_language(x, types = c("locale", "variant", "ISO639.1", "ISO639.2T",
  "ISO639.2B", "ISO639.3", "ISO639.6", "wikipedia", "other", "autonym", "en",
  "fr", "de", "ru", "es", "it", "zh"))

Arguments

x

Character string.

types

Types of strings to match against, as the corresponding column names in the Language_codes table.

Value

Corresponding, highest-level ISO or Wikipedia language code, or x if no unique match was found.

See Also

Other helper functions: capitalize_words, ch1903_to_wgs84, clean_strings, format_addresses, format_scientific_names, is.empty, lvapply, melt_by_listcol, na.remove, parse_scientific_names, quotemeta, replace_values_in_list, sp_transform, subset_search_results, unique_na

Examples

normalize_language("spa")
normalize_language("Spanish")
normalize_language("Espagnol")

falling-fruit/fruitr documentation built on Dec. 21, 2024, 8:32 p.m.