Skip to contents

Recode variables with regular expression based on the specification in tbl_KodeBok with TYPE RE. The specification in the codebook can be specific, common or general. Specific is when both LESID and FILGRUPPE are specified to create a unique reference to be able to recode the variables. Common is when only FILGRUPPE is specified while LESID left empty and general is when FILGRUPPE is specified with ALLE while LESID left empty.

Usage

do_recode_regexp(dt = NULL, spec = NULL, con = NULL)

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