Skip to contents

Change the default names of sets and elements.

Usage

rename_elements(object, old, new)

# S4 method for class 'TidySet'
rename_elements(object, old, new)

Arguments

object

A TidySet object.

old

A character vector of to be renamed.

new

A character vector of with new names.

Value

A TidySet object.

Methods (by class)

  • rename_elements(TidySet): Rename elements

Examples

x <- list("A" = letters[1:5], "B" = letters[3:7])
TS <- tidySet(x)
name_elements(TS)
#> [1] "a" "b" "c" "d" "e" "f" "g"
TS2 <- rename_elements(TS, "a", "first")
name_elements(TS2)
#> [1] "first" "b"     "c"     "d"     "e"     "f"     "g"