matchNested | R Documentation |
Match inside nested elements
matchNested(x, table, ...)
## S4 method for signature 'character,DFrame'
matchNested(x, table)
## S4 method for signature 'character,data.frame'
matchNested(x, table)
## S4 method for signature 'character,list'
matchNested(x, table)
x |
The values to be matched. |
table |
The values to be matched against.
Applies across rows for |
... |
Additional arguments. |
Intentionally only performs exact matching. Refer to filterNested
function
for partial matching support with regular expressions.
integer
.
A positional vector corresponding to values defined in table
the same
size as x
.
Updated 2023-09-21.
## list ====
x <- c("aaa", "bbb", "ccc")
table <- list(
c("a", "aa", "aaa"),
list(c("b", "bb", "bbb")),
list(list(c("c", "cc", "ccc")))
)
matchNested(x = x, table = table)
## data.frame ====
x <- c("aaa", "bbb", "ccc", "ddd")
table <- data.frame(
"V1" = c("a", "aa", "aaa"),
"V2" = I(list(
c("b", "bb", "bbb"),
c("c", "cc", "ccc"),
c("d", "dd", "ddd")
))
)
matchNested(x = x, table = table)
## DFrame ====
x <- c("aaa", "bbb", "ccc", "ddd")
table <- S4Vectors::DataFrame(
"V1" = c("a", "aa", "aaa"),
"V2" = I(list(
c("b", "bb", "bbb"),
c("c", "cc", "ccc"),
c("d", "dd", "ddd")
))
)
matchNested(x = x, table = table)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.