findThem | R Documentation |
Given a set of values and a vector where the values must be found,
findThem
records the matched values and the position in the vector
where the values have been searched for.
findThem(what, where, todf = FALSE, reportnomatch = FALSE)
what |
a vector a values to be searched for. |
where |
a vector where values will be searched on. |
todf |
a logical. Should the output object must be a data frame? |
reportnomatch |
a logical. If |
A list indicating matched positions for each elements of what
. If no match
is found then NA
is returned. If todf
is TRUE
then a three-columns data
frame is returned including values and positions in both what
and where
vectors.
which()
x <- stats::rpois(1000,10) findThem(c(10,4,100), x) findThem(c(10,4,100), x, todf=TRUE) findThem(c(10,4,100), x, todf=TRUE, reportnomatch=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.