has_names {msgr} | R Documentation |
Checks whether the variable has names
has_names(x, nm)
x |
(any) The object to test |
nm |
(character, optional) The names to check for. If not specified then the function checks for any names. |
TRUE if x has any names, FALSE otherwise
x <- list(a = 1, b = 2)
has_names(x, "a")
has_names(x, c("a", "b"))
has_names(x, "c")