set_names

0th

Percentile

Set Names

Sets the names of x to nm. If nm is a function, it is used to transform the already existing names of x.

Usage
set_names(x, nm = x, ...)
Arguments
x

:: vector().

nm

:: (character() | function()) New names, or function which transforms already existing names.

...

:: any Passed down to nm if nm is a function.

Value

x with updated names.

Aliases
  • set_names
Examples
# NOT RUN {
x = letters[1:3]

# name x with itself:
x = set_names(x)
print(x)

# convert names to uppercase
x = set_names(x, toupper)
print(x)
# }
Documentation reproduced from package mlr3misc, version 0.1.0, License: LGPL-3

Community examples

Looks like there are no examples yet.