Skip to contents

Recode variables based on the specification in tbl_KodeBok ie. codebook. LESID must be combined with FILGRUPPE to create a unique reference to be able to recode the variables. Specification group ALLE will be used when neither FILGRUPPE nor LESID is specified.

Usage

do_recode(dt = NULL, spec = NULL, con = NULL, control = FALSE)

Arguments

dt

Input data preferrably in a data.table format but is not mandatory

spec

Specifications data as a data.frame

con

Connection to database

control

Logical value. TRUE if the file has been controlled for possible errors