Adds granularity_geo to a given data set
Source:R/add_variable_to_data_set.R
add_granularity_geo_to_data_set.Rd
Adds granularity_geo to a given data set
Examples
library(data.table)
data <- data.table(location_code = c("norge", "county03", "blah"))
csdata::add_granularity_geo_to_data_set(data)
print(data)
#> location_code granularity_geo
#> <char> <char>
#> 1: norge nation
#> 2: county03 county
#> 3: blah blah
library(data.table)
data <- data.table(location_code = c("norge", "county03", "blah"))
csdata::add_granularity_geo_to_data_set(data, location_reference = csdata::nor_locations_names())
print(data)
#> location_code granularity_geo
#> <char> <char>
#> 1: norge <NA>
#> 2: county03 <NA>
#> 3: blah <NA>