Learn R Programming

eatGADS (version 1.1.1)

changeVarNames: Change Variable Names.

Description

Change variable names of a GADSdat or all_GADSdat object.

Usage

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

Value

Returns the GADSdat object with changed variable names.

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?

Details

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

Examples

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

Run the code above in your browser using DataLab