Skip to contents

Does the input contain specific dimensions?

Usage

isOfDimension(x, n)

Arguments

x

Object.

n

integer(1). Number to include.

Value

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

Note

Updated 2021-10-08.

See also

  • assertive.properties::is_of_dimension().

Examples

x <- data.frame(a = c(TRUE, FALSE), b = c(FALSE, TRUE))
dim(x)
#> [1] 2 2

## TRUE ====
isOfDimension(x, n = c(2L, 2L))
#> [1] TRUE

## FALSE ====
isOfDimension(x, n = c(1L, 2L))
#> [1] FALSE
isOfDimension(x, n = c(2L, 1L))
#> [1] FALSE