Learn R Programming

discretes (version 0.1.0)

has_discretes: Check which values are in a numeric series

Description

Check which values are in a numeric series

Usage

has_discretes(x, values, ..., tol = sqrt(.Machine$double.eps))

Value

A logical vector indicating whether each value is in the numeric series x. NA values are preserved such that NA in values results in NA in the output.

Arguments

x

Numeric series (numeric vector or object of class "discretes").

values

A vector of values to check.

...

Reserved for future extensions; must be empty.

tol

Numerical tolerance when checking if a value is in the series. Single non-negative numeric. See next_discrete() for details.

Examples

Run this code
has_discretes(natural0(), c(-1, 0, 1, 12.5, NA))
has_discretes(1 / natural1(), 0)

Run the code above in your browser using DataLab