Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

has_element

Does a list contain an object?


Description

Does a list contain an object?

Usage

has_element(.x, .y)

Arguments

.x

A list or atomic vector.

.y

Object to test for

Examples

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

purrr

Functional Programming Tools

v0.3.4
GPL-3 | file LICENSE
Authors
Lionel Henry [aut, cre], Hadley Wickham [aut], RStudio [cph, fnd]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.