Does the input have names?

hasNames(x, .xname = getNameInParent(x))

Arguments

x

Object.

.xname

Not intended to be used directly.

Value

TRUE on success; FALSE on failure, with cause attribute set.

See also

Examples

## TRUE ==== hasNames(datasets::mtcars)
#> [1] TRUE
## FALSE ==== hasNames(matrix())
#> [1] FALSE #> Cause of failure: #> The names of matrix() are NULL.
hasNames(data.frame())
#> [1] FALSE #> Cause of failure: #> The names of data.frame() are all empty.