names2

0th

Percentile

A Type-Stable names() Replacement

A simple wrapper around base::names(). Returns a character vector even if no names attribute is set. Values NA and "" are treated as missing and replaced with the value provided in missing_val.

Usage
names2(x, missing_val = NA_character_)
Arguments
x

:: any Object.

missing_val

:: atomic(1) Value to set for missing names. Default is NA_character_.

Value

(character(length(x))).

Aliases
  • names2
Examples
# NOT RUN {
x = 1:3
names(x)
names2(x)

names(x)[1:2] = letters[1:2]
names(x)
names2(x, missing_val = "")
# }
Documentation reproduced from package mlr3misc, version 0.1.0, License: LGPL-3

Community examples

Looks like there are no examples yet.