Reject() is the opposite of Filter. Reject applies the negation of the unary predicate function .f to each element of .x, coercing to logical if necessary, and returns the subset of .x for which this gives true. Note that possible NA values are currently always taken as false; control over NA handling may be added in the future.

Reject(.x, .f)

Arguments

.x

a vector.

.f

a predicate function.

Value

.x filtered where .f applies

See also

Other predicate functionals: All; Any

Examples

# Some examples Filter(function(x) x < 5, 1:10)
#> [1] 1 2 3 4
Reject(1:10, function(x) x < 5)
#> [1] 5 6 7 8 9 10