validityElement: Validate if is element

validityElementR Documentation

Validate if is element

Description

Check that all values of a vector x is element of values of y and return an error otherwise.

Usage

validityElement(x, y, name)

Arguments

x

vectors (of the same mode) containing a sequence of items (conceptually) with no duplicated values.

y

vectors (of the same mode) containing a sequence of items (conceptually) with no duplicated values.

name

variable name to return in the error message

Value

Return TRUE if the condition is respected and an error otherwise.

Examples

x <- c(1,2,3)
y <- c(2,3)
z <- c(1,2,3,4)
validityElement(x, y, name = "w")
validityElement(x, z, name = "w")


aleblancbio/timescale documentation built on Aug. 27, 2022, 3:01 p.m.