rename | R Documentation |
rename
renames the specified variable in a data frame.
rename(data, from, to)
data |
Data frame that contains the variable to rename |
from |
Variable to be renamed. |
to |
New variable name. |
A simple wrapper for R code:
names(data)[which(names(data) == from)] <- to
Exists to save the extra complexity and typing when renaming a variable in a data frame.
David W. Gerbing (Portland State University; gerbing@pdx.edu)
recode
.
d <- Read("Mach4", quiet=TRUE)
names(d)
d <- rename(d, m03, third)
names(d)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.