mlr-org / mlr3misc

Miscellaneous helper functions for mlr3
https://mlr3misc.mlr-org.com
GNU Lesser General Public License v3.0
12 stars 3 forks source link

can we get has_element? #2

Closed berndbischl closed 5 years ago

berndbischl commented 5 years ago

we currently use code like this instead

any(map_lgl(xs, identical, x)))

mllg commented 5 years ago

For atomics it is much faster to use match / is.element. Do you really need it for more complex objects?

berndbischl commented 5 years ago

paradox has that. and this is a very general thing. i would like to have it. we can document what you just said?

berndbischl commented 5 years ago

i added it, doced it and tested it, especially with r6 (which is what i need it for)