Skip to contents

Performs case-insensitive matching between elements in x and entries in table, returning a named character vector: matched table entries as names, and x as values. Unmatched values are assigned a default name ("unknown") but removed before returning.

Usage

x %map% table

Arguments

x

Character vector of input strings.

table

Character vector to match against.

Value

A named character vector. Names come from matched table values, values from x.

Examples

c("tp53", "brca1", "egfr") %map% c("TP53", "EGFR", "MYC")
#> Error in c("tp53", "brca1", "egfr") %map% c("TP53", "EGFR", "MYC"): could not find function "%map%"
# → Named vector with matches: TP53 = "tp53", EGFR = "egfr"