View source: R/norgeo-recode.R
do_geo_recode | R Documentation |
Recode geographical codes to the current year. Codes is based on
norgeo::track_change()
function. For a split geogaphical codes from
previous year, the first code of the current year code in chronological order
will be selected to recode.
do_geo_recode(
dt = NULL,
code = NULL,
type = c("grunnkrets", "fylke", "kommune", "bydel"),
year = NULL,
con = NULL,
geo = NULL,
base = NULL,
control = FALSE,
...
)
dt |
Input data preferrably in a |
code |
Code dataset of old and new codes in a |
type |
The geographical granularity for recoding. The dataset is the
output after running |
year |
Which year the geograhical codes to be recoded to. If it is empty
then global option for |
con |
Connection to database |
geo |
Logical value. Keep old geographical code if TRUE. Default is FALSE. |
base |
Logical value. If |
control |
Logical value. |
... |
Any additional arguments |
Other geo recode functions:
do_recode_without_aggregate()
,
get_geo_recode()
## Not run:
code <- get_geo_recode(con = geo$dbconn, type = "grunnkrets")
dt <- make_file("BEFOLKNING", aggregate = FALSE)
DT <- do_geo_recode(dt, code)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.