Skip to contents

Change variable names of a GADSdat or all_GADSdat object.

Usage

changeVarNames(GADSdat, oldNames, newNames, checkVarNames = TRUE)

Arguments

GADSdat

GADSdat object imported via eatGADS.

oldNames

Vector containing the old variable names.

newNames

Vector containing the new variable names, in identical order as oldNames.

checkVarNames

Logical. Should new variable names be checked by checkVarNames?

Value

Returns the GADSdat object with changed variable names.

Details

Applied to a GADSdat or all_GADSdat object, this function is a wrapper of getChangeMeta and applyChangeMeta

Examples

# Change multiple variable name
pisa2 <- changeVarNames(pisa, oldNames = c("idstud", "idschool"),
                        newNames = c("IDstud", "IDschool"))