check_length: Check Length

Description Usage Arguments Value Examples

View source: R/check-length.R

Description

Checks length of an object is within bounds.

Usage

1
2
3
4
5
6
check_length(
  x,
  min_length = 1L,
  max_length = max_integer(),
  x_name = substitute(x)
)

Arguments

x

The object to check.

min_length

A count of the minimum length.

max_length

A count of the maximum length.

x_name

A string of the name of the object.

Value

Throws an informative error or returns an invisible copy of the object.

Examples

1
try(check_length(1:2, 3L))

poissonconsulting/deckr documentation built on March 18, 2021, 10:37 a.m.