Does the input have dimnames?
Examples
## TRUE ====
x <- datasets::mtcars
hasDimnames(x)
#> [1] TRUE
hasRownames(x)
#> [1] TRUE
hasColnames(x)
#> [1] TRUE
## FALSE ====
x <- data.frame()
hasDimnames(x)
#> [1] FALSE
hasRownames(x)
#> [1] FALSE
hasColnames(x)
#> [1] FALSE