rename_cols: Renames one or several columns in a data.frame

Description Usage Arguments Details Value

Description

Renames one or several columns in a data.frame

Usage

1
rename_cols(dat, oldnames, newnames)

Arguments

dat

a data.frame containing the columns to be renamed.

oldnames

a character vector of column names to be be renamed.

newnames

a character vector of new names for the columns to be renamed.

Details

This function can be used in lieu of other functions in well know packages such as dplyr, plyr, and data.table. The squeleton of the function was found at: http://stackoverflow.com/questions/21502465/replacement-for-rename-in-dplyr.

Value

the same data.frame with columns with new names.


hmenag1/hmUtils documentation built on May 17, 2019, 4:34 p.m.