%OF% {dipsaus}R Documentation

Get an element with condition that it must be from a list or vector

Description

Get an element with condition that it must be from a list or vector

Usage

lhs %OF% rhs

Arguments

lhs

the element of candidate

rhs

the constraint

Value

Returns an element of length one that will be from rhs

Examples


# C is from LETTERS, therefore returns `C`
"C" %OF% LETTERS


# `lhs` is not from `rhs`, hence return the first element of LETTERS
'9' %OF% LETTERS
NULL %OF% LETTERS

# When there are multiple elements from `lhs`, select the first that
# matches the constraint
c('9', "D", "V") %OF% LETTERS


[Package dipsaus version 0.2.9 Index]