assert_length: Check Object Length(s)

View source: R/assert.R

assert_lengthR Documentation

Check Object Length(s)

Description

Check Object Length(s)

Usage

assert_length(
  x,
  expected,
  allow_empty = empty,
  allow_null = FALSE,
  empty = FALSE
)

assert_lengths(x, expected)

Arguments

x

An object to be checked.

expected

An appropriate expected value.

allow_empty

A logical scalar: should empty object be ignored?

allow_null

A logical scalar: should NULL object be ignored?

empty

Deprecated.

Value

Throws an error, if any, and returns x invisibly otherwise.

Author(s)

N. Frerebeau

See Also

Other checking methods: assert_constant(), assert_dim(), assert_empty(), assert_infinite(), assert_lower(), assert_missing(), assert_names(), assert_numeric, assert_package(), assert_square(), assert_type(), assert_unique()


tesselle/arkhe documentation built on Feb. 1, 2025, 9:24 a.m.