renamer | R Documentation |
a wrapper function for renaming functions in plyr package
renamer(data, from, to, warn_missing = TRUE)
data |
a dataframe or a vector |
from |
names in data to be changed from |
to |
names to changed to |
warn_missing |
TRUE/FALSE whether a warning message will be returned if the from values not present in data |
l <- "first" k <- "second" renamer(names(iris), from = "Species", to = "k") renamer(names(iris), from = c("Species", "Sepal.Length"), to = c("hey", "tyfg")) renamer(names(iris), from = names(iris)[1], to = c("hey")) renamer(names(iris), from = 1, to = "k") renamer(names(iris), from = 1, to = l) renamer(names(iris), from = "Species", to = k) renamer(names(iris), from = "Specis", to = k) renamer(iris, from = "Species", to = "k") renamer(iris, from = c("Species", "Sepal.Length"), to = c("hey", "tyfg")) renamer(iris, from = names(iris)[1], to = c("hey")) renamer(iris, from = 1, to = "k") renamer(iris, from = 1, to = l) renamer(iris, from = "Species", to = k) renamer(iris, from = "Specis", to = k)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.