dptofactor: Recode a variable to factor using the associated Code List

View source: R/dptofactor.R

dptofactorR Documentation

Recode a variable to factor using the associated Code List

Description

Recode a variable to factor using the associated Code List

Usage

dptofactor(x, codelist = dpcodelist(x), warn = TRUE)

Arguments

x

the variable to recode

codelist

a data.frame with the Code List. It is assumed that the first column contains the codes and the second column the labels.

warn

give a warning when there is no code list.

Value

Returns a factor vector or x when no Code List could be found (codelist = NULL).


djvanderlaan/datapackage documentation built on March 18, 2024, 4:57 p.m.