Is there a fast/clever way to return a logical vector if elements of a vector are in at least one interval?
Assume you have vector numeric vector x
and a data frame df
with columns start
and stop
. Is there a clever way to return a logical vector with length equal to x
indicating if x is in at least one interval defined by start
or stop
?