chk_at_most_one_na_vector: Check that a vector or list has 0 or 1 NAs

Description Usage Arguments Examples

View source: R/chk-single.R

Description

In the case of a list, an item is 'NA' if it has at least one element, and of these elements are NA

Usage

1
2
3
4
5
6
7

Arguments

x

An integer vector.

name

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

Examples

1
2
3
4
x <- c(0L, 1L, NA)
chk_at_most_one_na_vector(x, name = "x")
x <- c(c(0L, 1L), c(2L, NA))
chk_at_most_one_na_list(x, name = "x")

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