chk_non_negative: Check that elements of a scalar or vector are non-negative

Description Usage Arguments See Also Examples

Description

NAs are ignored.

Usage

1
2
3
4
5
6
7

Arguments

x

A scalar or vector.

name

The name for x that will be used in error messages.

See Also

chk_positive_scalar

Examples

1
2
3
4
5
6
x <- 0.1
chk_non_negative_scalar(x, name = "x")
x <- NA_integer_
chk_non_negative_scalar(x, name = "x")
x <- c(0.1, 0, NA)
chk_non_negative_vector(x, name = "x")

johnrbryant/demcheck documentation built on Dec. 31, 2021, 11:57 a.m.