edu_recode: Recode new 9 levels into old

View source: R/edu-funcs.R

edu_recodeR Documentation

Recode new 9 levels into old

Description

New nettskjema data requires codebook to not have special characters, and as such the old and new coding scheme does not fit. This function turns new coding scheme into the old, wanted one

Usage

edu_recode(x, names = TRUE)

Arguments

x

character vector of old scheme

names

logical. toggle return of names rather than numbers

Value

character

Examples

eds <- c(NA, "UnderGrad_BA", "HighSchool_Initial", "PostGrad_MA", 
   "PostGrad_PhD", "HighSchool", "Junior-HighSchool", "HighSchool_addition")
edu_recode(eds) 

eds <- c(1,5,8,2,6,9,1,10)
edu_recode(eds, names = FALSE) 

LCBC-UiO/Questionnaires documentation built on July 18, 2023, 6:45 p.m.