not.names: Identify Elements That are Not Names

View source: R/str2str_functions.R

not.namesR Documentation

Identify Elements That are Not Names

Description

not.names identifies which elements from nm are not names of x. If all elements are names, then a character vector of length 0 is returned.

Usage

not.names(x, nm)

Arguments

x

object with a names attribute

nm

character vector specifying the elements to test as names of x.

Value

character vector containing the elements of nm that are not names of x.

Examples

v <- setNames(object = letters, nm = LETTERS)
not.names(x = v, nm = c("A","a"))
data("mtcars")
not.names(x = mtcars, nm = c("MPG","mpg"))
not.names(x = mtcars, names(mtcars)) # returns a character vector of length 0

str2str documentation built on Nov. 21, 2023, 1:08 a.m.