recodeData {eatPrep} | R Documentation |
Recode datasets with special consideration of missing values. See collapseMissings
for supported types of missing values.
recodeData(dat, values, subunits, verbose = FALSE)
dat |
A data frame |
values |
A data frame with code information. See ‘Details’. |
subunits |
A data frame with subunit information. See ‘Details’. |
verbose |
Logical. If |
recodeData
recodes data frames with special consideration of missing values. recodeData
will give warnings, if missing or incomplete recode informations are found. Values without recode information will not be recoded.
Examples of data frames values
and subunits
can be found via data(inputList)
.
A data frame with recoded variables according to the specifications in values
and subunits
. The columns will be named according to the specifications in subunits$subunitRecoded
.
Martin Hecht, Christiane Penk, Nicole Haag
aggregateData
, automateDataPreparation
, inputList
data(inputDat) data(inputList) dat1 <- inputDat[[1]] # get first dataset from inputDat datRec <- recodeData(dat1, inputList$values, inputList$subunits, verbose = TRUE) str(datRec)