rename.variables: rename variables function

View source: R/format.R

rename.variablesR Documentation

rename variables function

Description

easier way to rename variables over base r. give a new name and old name (or a vector of new and old names) and this function will change them in the dataset

Usage

rename.variables(data, newname, oldname = NULL)

Arguments

data

dataframe containing names to convert

newname

list of new names that you want for the data frame, if you do not want to change the name of every column then a vector of old names the same length as this should als be supplied

oldname

a vector of old names the same length as newname which will do a 1:1 match for replacement. if left blank all column names will be relpace (i.e. newname should be a vector the name length as ncol(data))

Examples

rename.variables_function()

clmacleod/highlandr documentation built on Oct. 11, 2023, 8:04 p.m.