matchAll | R Documentation |
Match all positions of an argument
matchAll(x, table, ...)
## S4 method for signature 'character,character'
matchAll(x, table, simplify = FALSE)
## S4 method for signature 'factor,factor'
matchAll(x, table, simplify = FALSE)
## S4 method for signature 'numeric,numeric'
matchAll(x, table, simplify = FALSE)
x |
The values to be matched. |
table |
The values to be matched against. |
simplify |
|
... |
Additional arguments. |
matchAll()
behaves like base match()
, but is intended to return a list
of all position matches of the argument defined in x
.
list
.
A list of positional vectors corresponding to values defined in table
the
same size as x
.
Updated 2023-12-15.
## character ====
x <- c("c", "b", "a")
table <- c("a", "b", "c", "a", "b", "c")
i <- matchAll(x = x, table = table, simplify = FALSE)
print(i)
i <- matchAll(x = x, table = table, simplify = TRUE)
print(i)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.