renameAllDataframeColumns: renameAllDataframeColumns

Description Usage Arguments Details Value Examples

View source: R/renameAllDataframeColumns.R

Description

This function renames all the columns in a dataframe.

Usage

1
2
renameAllDataframeColumns(dataframe, newColumnNames, truncateColumns = FALSE,
  truncateStartColumn = 1)

Arguments

dataframe

the dataframe to edit

newColumnNames

the new column names

truncateColumns

if TRUE this function removes extra columns not in the column names

truncateStartColumn

starting column number truncation starts

Details

This function is useful because wind measuring equipment may output a less than ideal format for R. If column names are less than ideal for use in R this function can be used to change the names of all of the columns.

The first parameter is the dataframe

The second parameter is the column names to change the header.

If truncate columns is true then extra columns are removed. This is useful if a header does not import properly.

Value

same dataframe except with columns renamed

Examples

1
2
df <- data.frame(Column1 = 1, Column2 = 2)
renameAllDataframeColumns(df, c('ColumnA', 'ColumnB'))

Agriculturist/EmissionsHelper documentation built on July 19, 2020, 5:27 p.m.