Skip to contents

Validates that all elements of the value are among the allowed values. For a vector this is the subset test: every element must be one of values.

Usage

require_one_of(restriction, values)

Arguments

restriction

a restriction object.

values

vector of allowed values.

Value

The modified restriction object.

Details

NA elements are skipped; chain require_no_na() to reject them. Use require_contains() for the reverse direction (the value must hold all of values) and require_set_equal() for both.