has_element: Does a list contain an object?

Description Usage Arguments Examples

View source: R/detect.R

Description

Does a list contain an object?

Usage

1
has_element(.x, .y)

Arguments

.x

A list or atomic vector.

.y

Object to test for

Examples

1
2
3
x <- list(1:10, 5, 9.9)
x %>% has_element(1:10)
x %>% has_element(3)

Example output

[1] TRUE
[1] FALSE

purrr documentation built on April 19, 2020, 4:17 p.m.