renameCodebook: A command to match variable names in a given data set with...

Description Usage Arguments Details Value See Also

Description

A data set contains variable names, which are usually short. The more meaningful variable names are stored in a codebook, e. g. in Excel. This function allows matching and replacing/renaming the variable names in the data set with the variable names from the codebook.

Usage

1
2
renameCodebook(data, codebook, code.old.vars = "varname",
  code.new.vars = "new.varname")

Arguments

data

The data frame.

codebook

The codebook which must be in the current working directory as a data frame

code.old.vars

The column in the codebook, in which the original (short) variable names are stored (default is to varname, as in Unipark)

code.new.vars

The column in the codebook, in which the new (usually longer, meaningful) variable names are stored (default is to new.varname, as in Unipark)

Details

Details to be shown

Value

Returns the original data set with names replaced from the Codebook. All names in the data set that do not appear in the Codebook remain unchanged.

See Also

matchItems


kthorstmann/horst documentation built on May 20, 2019, 7:04 p.m.