rename.vars: Function rename.vars Source code from gdata as gdata is...

Description Usage Arguments Value Author(s) Examples

Description

Function rename.vars
Source code from gdata as gdata is unmaintained since 2017-06-06
Rename variables in a dataframe

Usage

1
rename.vars(data, from = "", to = "", info = TRUE)

Arguments

data

frame to be modified.

from

character vector containing the current name of each variable to be renamed.

to

character vector containing the new name of each variable to be renamed.

info

boolean value indicating whether to print details of the removal/renaming. Defaults to TRUE.

Value

returns the updated data frame with variables listed in from renamed to the corresponding element of to.

Author(s)

Don MacQueen (package gdata), macq\@llnl.gov.

Examples

1
2
3
4
5
6
{ data <- data.frame(x=1:10,y=1:10,z=1:10)
names(data)
data <- rename.vars(data, c("x","y","z"), c("first","second","third"))
names(data)

}

Dominance documentation built on Feb. 23, 2021, 5:13 p.m.