has_element

0th

Percentile

Check if an Object is Element of a List

Simply checks if a list contains a given object.

  • NB1: Objects are compared with identity.

  • NB2: Only use this on lists with complex objects, for simpler structures there are faster operations.

  • NB3: Clones of R6 objects are not detected.

Usage
has_element(.x, .y)
Arguments
.x

:: (list() or atomic vector).

.y

:: any Object to test for.

Aliases
  • has_element
Examples
# NOT RUN {
has_element(list(1, 2, 3), 1)
# }
Documentation reproduced from package mlr3misc, version 0.1.0, License: LGPL-3

Community examples

Looks like there are no examples yet.