Does the input have dimnames?

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

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

Arguments

x

Object.

.xname

Name of object defined in x. Not intended to be used directly.

Value

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

Note

Updated 2019-08-10.

See also

Examples

## TRUE ==== x <- datasets::mtcars hasDimnames(x)
#> [1] TRUE
#> [1] TRUE
hasColnames(x)
#> [1] TRUE
## FALSE ==== x <- data.frame() hasDimnames(x)
#> [1] FALSE #> Cause: The dimension names of 'x' are all empty.
#> [1] FALSE #> Cause: 'x' has integer row names (soft NULL).
hasColnames(x)
#> [1] FALSE #> Cause: The column names of 'x' are all empty.