View source: R/detect_region_variables.R
detect_region_var | R Documentation |
Given data, looks for the variable that contains regions. Returns the name of this variable and the corresponding variable name in get_regionkey()
detect_region_var(data, year = NULL, offline = TRUE)
data |
data.frame |
year |
double, year of the used classification |
offline |
logical, whether works offline with package data. Defaults to |
character(2) Returns the region variable in the original data and the corresponding region
variable in the get_regionkey()
# Generate random municipal data with random name for the regions
data <- get_regionkey() |>
dplyr::select(kunta_name) |>
dplyr::rename_with(~paste(sample(letters, 4), collapse = "")) |>
dplyr::mutate(values = rnorm(dplyr::n()))
detect_region_var(data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.