change_names | R Documentation |
Change the variable names of a data.frame
change_names(x, from, to, must_have=TRUE)
x |
data.frame |
from |
column names to be changed |
to |
what column names need to be changed to |
must_have |
logical. Give an error of one of the names is not present or duplicated |
data.frame
d <- data.frame(x=1:3, y=3:5, z=10:12)
change_names(d, c("y", "z"), c("B", "C"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.