renameDataframeColumn: renameDataframeColumn

Description Usage Arguments Details Value Examples

View source: R/renameDataframeColumn.R

Description

This function renames a single column in R.

Usage

1
renameDataframeColumn(dataframe, oldColumnName, newColumnName)

Arguments

dataframe

the dataframe to edit

oldColumnName

the old column name (Can also be the number of the column)

newColumnName

the new name to change the old name to

Details

The first parameter is the dataframe name to change

The second column name is either the old column name or the index of the column.

The third is the name to change the dataframe to

Value

same dataframe except with columns renamed

Examples

1
2
3
df <- data.frame(Column1 = 1, Column2 = 2)
df <- renameDataframeColumn(df, 'Column1', 'ColumnX')
df <- renameDateframeColumn(df, 2, 'ColumnY')

JerryHMartin/EmissionsHelper documentation built on July 15, 2020, 12:44 a.m.