rename | R Documentation |
Simple function to rename a column in a data.frame The rename is done "in place", no need to reassign the data.frame A message is printed to confirm the change
rename(data, oldname, newname)
data |
A data frame passed to the function |
oldname |
Name of the column/variable to rename |
newname |
New name to apply |
Data.frame and column names are passed to the function as symbols (without "")
Nothing, the passed data.frame is modified directly
df <- as.data.frame( c(One=1,Two=2) )
rename(df,Two,Last)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.