rename {memisc}R Documentation

Change Names of a Named Object

Description

rename changes the names of a named object.

Usage

rename(x, ...)

Arguments

x Any named object
... A sequence of named arguments, all of type character

Details

This function changes the names of x according to the remaining arguments. The argument names are the old names, the values are the new names.

Value

The object x with new names defined by the ... arguments.

Examples

  x <- c(a=1, b=2)
  rename(x,a="A",b="B")
  
  str(rename(iris,
                  Sepal.Length="SepalLength",
                  Sepal.Width ="SepalWidth",
                  Petal.Length="PetalLenght",
                  Petal.Width ="PetalWidth"
                  ))

[Package memisc version 0.11-8-2 Index]