R Under development (unstable) (2026-01-21 r89314 ucrt) -- "Unsuffered Consequences" Copyright (C) 2026 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(ribiosUtils) > > test <- mmatch(c("A", "B", "C", "T", "B", "S", "Z", NA, "C", NULL), + c("A", "B","C","D", "A", "D", "B", "C", "C", "A")) > test2 <- mmatch(c("A", "B", "C", "T", "B", "S", "Z", NA, "C", NULL), + c("A", "B","C","D", "A", "D", "B", "C", "C", "A"), + nomatch=0) > > torSource <- sample(letters, 20000, replace=TRUE) > torTarget <- sample(letters, 20000, replace=TRUE) > system.time(torMatch <- match(torSource, torTarget)) user system elapsed 0 0 0 > system.time(torMultiMatch <- mmatch(torSource, torTarget)) user system elapsed 0.20 0.03 0.23 > > namedSources <- c(a="txt", b="csv", c="pdf") > nmm <- mmatch(namedSources, c("csv", "pdf", "pdf", "txt", NA)) > ## all(sapply(1:20000, function(x) identical(unique(torTarget[torMultiMatch[[x]]]), torSource[[x]]))) > > > > proc.time() user system elapsed 0.34 0.07 0.40