Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

is.names

Test for 'names'


Description

is.names returns whether elements of a character vector are names of an object.

Usage

is.names(nm, x)

Arguments

nm

character vector.

x

object whose names are desired to be tested.

Details

If the object does not have any names, then the function will return 'FALSE' for each element 'nm'.

Value

TRUE for every element of 'nm' that is a name of 'x' and FALSE otherwise. The structure is a logical vector with length = length('nm') and names = 'nm'. See details for special cases.

Examples

v <- setNames(object = letters, nm = LETTERS)
is.names(x = v, nm = c("A","a"))
data("mtcars")
is.names(x = mtcars, nm = c("MPG","mpg"))

str2str

Convert R Objects from One Structure to Another

v0.1.1
GPL (>= 2)
Authors
David Disabato [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.