Description Usage Arguments Details Value Examples
View source: R/renameAllDataframeColumns.R
This function renames all the columns in a dataframe.
1 2 | renameAllDataframeColumns(dataframe, newColumnNames, truncateColumns = FALSE,
truncateStartColumn = 1)
|
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 |
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.
same dataframe except with columns renamed
1 2 | df <- data.frame(Column1 = 1, Column2 = 2)
renameAllDataframeColumns(df, c('ColumnA', 'ColumnB'))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.