df <- data.frame(sid = c("S1", "S2"), age = c(25, -99),
sex = c("1", "2"), stringsAsFactors = FALSE)
cb <- list(
age = list(missing = -99, type = "integer"),
sex = list(rename = "gender", recode = c("1" = "M", "2" = "F"),
label = "Gender")
)
dcc_apply_codebook(df, cb)
dcc_apply_codebook(df, cb, dry_run = FALSE)
Run the code above in your browser using DataLab