Does the input have dimensions?

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

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

hasCols(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 hasDims(x)
#> [1] TRUE
hasRows(x)
#> [1] TRUE
hasCols(x)
#> [1] TRUE
## Note that dims don't have to be non-zero, just not NULL. hasDims(data.frame())
#> [1] TRUE
## FALSE ==== x <- data.frame() hasDims(list())
#> [1] FALSE #> Cause: The dimensions of 'list()' are NULL.
hasRows(x)
#> [1] FALSE #> Cause: The number of rows in 'x' is zero.
hasCols(x)
#> [1] FALSE #> Cause: The number of columns in 'x' is zero.