Skip to contents

Does a value satisfy a type?

Usage

is_valid(t, x)

Arguments

t

A type, or anything as_type() accepts.

x

The value to test.

Value

TRUE or FALSE.

Examples

is_valid(int[1], 3)
#> [1] TRUE
is_valid(int[1], 3.5)
#> [1] FALSE
is_valid(chr, letters)
#> [1] TRUE