Skip to contents

Recode selected columns after cleaning and processing the filegroup based on the specification for FILGRUPPE in codebook with type PS. For example some columns in a filegroup doesn't have values for a specific year. This column should not have a value of 0. Instead a special symbol .. is given, representing that the column is missing because the value is not available for calculation. This is how to specify in FRA column in registration database to recode all years from 1990 to 2000 and TAB1 with value foo to a selected value in KOL column ie. AAR = 1990:2000 & TAB1 = "foo". Important to use symbol & if more than one conditions to recode. To use R code syntax directly asis, use raw prefix ie. raw(AAR == 1990:2000 & TAB1 == "foo"). Selection with %in%, %chin%, | etc. can be used with raw prefix.

Usage

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

Arguments

dt

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

spec

Specification from tbl_Filgruppe

con

Connection to database