names_are_unique_and_non_empty: Verify that the names of the given object are non-empty and...

Description Usage Arguments Value Examples

Description

Since R supports duplicate list names or empty list names, this function is handy for any verification of hash-like names: that is, none must be empty, and they must all be distinct.

Usage

1
2
names_are_unique_and_non_empty(obj, what = "", error = FALSE,
  character.only = FALSE)

Arguments

obj

any R object that has names.

what

character. A description to use when error = TRUE. For example, if what = "field" and no names were supplied, the error "No field names supplied" will trigger. The default is "".

error

logical. Whether or not to error if the names of the obj are not unique and non-empty. The default is FALSE, in which case a logical of length will be returned.

character.only

logical. Whether or not to call names on obj or just treat it as a character vector of names. THe default is FALSE.

Value

If error = TRUE, an error will be thrown if all the names of the obj are not non-empty and unique. Otherwise, TRUE or FALSE will be returned according as the names supplied are unique and non-empty.

Examples

1
2
3
4

robertzk/refclass documentation built on May 27, 2019, 10:36 a.m.