renameVars: Rename variables in a data frame using a mapping file

View source: R/renameVars.R

renameVarsR Documentation

Rename variables in a data frame using a mapping file

Description

Allows to easily utilize different version of variable naming, e.g. for diffnerent languages.

Usage

renameVars(data, rename)

Arguments

data

data.frame containing each variable in a spearate column

rename

mapping file (csv) to rename vars. Contains the following columns: OLD, NEW, TYPE, VARNAME, REFERENCE. OLD contains the old names, NEW the new ones, TYPE is VARNAME for variables (colnames of data), and LEVEL for the corresponding variable levels. VARNAME contains the old variable name to which each levels corresponds to. REFERENCE is the ordre for factors, 1 being the reference


mknoll/dataAnalysisMisc documentation built on Feb. 4, 2024, 8:16 a.m.