xpssRenameVariables: Renaming Variables

Description Usage Arguments Details Value Author(s) Examples

View source: R/xpssRenameVariables.R

Description

R implementation of the SPSS RENAME VARIABLES function. xpssRenameVariables renames variables within an exisiting data.frame or xpssFrame object.

Usage

1
xpssRenameVariables(x, oldVarNames = NULL, newVarNames = NULL)

Arguments

x

a (non-empty) data.frame or input data of class "xpssFrame".

oldVarNames

atomic character or character vector with the names of the variables to rename. oldVarNames must be a variable that already exists in the data set.

newVarNames

atomic character or character vector with the new variable names.

Details

Modifies names of one or more variables within a selected dataset. The arguments oldVarNames and newVarNames must have the same length.

Value

Returns the data with the renamed variables.

Author(s)

Andreas Wygrabek

Examples

1
2
3
4
5
data(fromXPSS)

xpssRenameVariables(fromXPSS,
oldVarNames= c("V1", "V2", "V3"),
newVarNames= c("Manufacturer", " Car Type", "Country"))

translateSPSS2R documentation built on May 30, 2017, 4:31 a.m.