renamecol: renamecol

Description Usage Arguments Value Examples

View source: R/renamecol.R

Description

This function is a wrapper for the more cumbersome base R syntax colnames(mydf)[colnames(mydf) == 'oldcolname'] <- 'newcolname' or the function dplyr::rename(mydf,c('foo'='samples'))

Usage

1
renamecol(mydf, oldcolname, newcolname)

Arguments

mydf

dataframe with column to be renamed

oldcolname

character string existing column name

newcolname

character string desired new column name

Value

dataframe

Examples

1
new_mtcars <- renamecol(mtcars, "mpg", "MPG")

smach/rmiscutils documentation built on Dec. 15, 2021, 1:49 a.m.