has_names: Checks whether the variable has names

Description Usage Arguments Value Examples

View source: R/predicates.R

Description

Checks whether the variable has names

Usage

1
has_names(x, nm)

Arguments

x

(any) The object to test

nm

(character, optional) The names to check for. If not specified then the function checks for any names.

Value

TRUE if x has any names, FALSE otherwise

Examples

1
2
3
4
5
6
x <- list(a = 1, b = 2)

has_names(x, "a")
has_names(x, c("a", "b"))

has_names(x, "c")

msgr documentation built on Dec. 16, 2019, 5:41 p.m.