chk_pos_initial: Check that an initial 'pos' argument

Description Usage Arguments See Also Examples

View source: R/chk-composite.R

Description

Check if x consists entirely of 1s (when zero_ok is FALSE), or of 1s and 0s (when zero_ok is TRUE).

Usage

1
2
3
chk_pos_initial(x, name, zero_ok)

err_pos_initial(x, name, zero_ok)

Arguments

x

An integer vector with positive length

name

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

zero_ok

Whether code can contain 0s.

See Also

chk_positive_dim

Examples

1
2
3
4
5
6
chk_pos_initial(x = c(1L, 1L, 1L),
                name = "pos",
                zero_ok = FALSE)
chk_pos_initial(x = c(1L, 0L, 1L),
                name = "pos",
                zero_ok = TRUE)

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