chk_all_x1_in_x2: Check whether all elements of 'x1' are in 'x2'

Description Usage Arguments Details Examples

View source: R/chk-composite.R

Description

Check x1 is contained in x2, potentially after excluding 0s from x1.

Usage

1
2
3
chk_all_x1_in_x2(x1, x2, name1, name2, exclude_zero)

err_all_x1_in_x2(x1, x2, name1, name2, exclude_zero)

Arguments

x1

A vector, typically integers.

x2

A vector, typically integers.

name1

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

name2

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

exclude_zero

Whether to exclude zeros from x1 before testing.

Details

The error message for chk_all_x1_in_x2 does not have quotes around the arguments, since these arguments are often expressions.

Examples

1
2
3
4
5
6
7
x1 <- c(0L, 1L, 2L, 0L)
x2 <- 1:3
chk_all_x1_in_x2(x1 = x2,
                 x2 = x2,
                 name1 = "x1",
                 name2 = "x2",
                 exclude_zero = TRUE)

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