is_square_matrix: Is the matrix a square matrix?

Description Usage Arguments Value Examples

Description

Checks that the input is a square matrix.

Usage

1
2
3
4
assert_is_square_matrix(x, severity = getOption("assertive.severity",
  "stop"))

is_square_matrix(x, .xname = get_name_in_parent(x))

Arguments

x

Input to check.

severity

How severe should the consequences of the assertion be? Either "stop", "warning", "message", or "none".

.xname

Not intended to be used directly.

Value

TRUE if the input is all zeroes (after coercion to be a matrix).

Examples

1
2

Example output

[1] TRUE
[1] FALSE
Cause of failure:  matrix(1:12, nrow = 3) is not a square matrix; its dimensions are 3, 4. 

assertive.matrices documentation built on May 1, 2019, 10:11 p.m.