| %match% | R Documentation |
Performs case-insensitive matching, like base::match(), but ignores letter case.
x %match% table
x |
Character vector to match. |
table |
Character vector of values to match against. |
An integer vector of the positions of matches of x in table,
like base::match(). Returns NA for non-matches. Returns an integer(0)
if x is length 0.
# Basic matching
c("tp53", "BRCA1", "egfr") %match% c("TP53", "EGFR", "MYC")
# returns: 1 NA 2
# No matches returns: all NA
c("aaa", "bbb") %match% c("xxx", "yyy")
# Empty input
character(0) %match% c("a", "b")
# Order sensitivity (like match): first match is returned
c("x") %match% c("X", "x", "x")
# returns: 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.