Learn R Programming

assertive (version 0.1-7)

assert_has_cols: Does the input have rows/columns?

Description

Checks to see if the input has rows/columns.

Usage

assert_has_cols(x)

  assert_has_rows(x)

  has_cols(x)

  has_rows(x)

Arguments

x
Input to check.

Value

  • has_rows and has_cols return TRUE if nrow and ncol respectively return a value that is non-null and positive. The assert_* functions return nothing but throw an error if the corresponding has_* function returns FALSE.

See Also

ncol.

Examples

Run this code
assert_has_rows(data.frame(x = 1:10))
assert_has_cols(matrix())

Run the code above in your browser using DataLab