bestMismatch | R Documentation |
Find fewest mismatches (and position if desired) between pattern and string without allowing gaps. Could be programmed better but quick enough for now.
bestMismatch(
pattern,
subject,
pos = findAll,
weights = rep(1, nchar(pattern)),
findAll = FALSE,
dummyChar = "|"
)
pattern |
String pattern to search for in subject |
subject |
Subject string to search in |
pos |
If TRUE return position in addition to distance |
weights |
Integer weights for each position of pattern |
findAll |
If TRUE return all best matches |
dummyChar |
A character that does not appear in either string (only necessary if findAll==TRUE [and could probably program better]) |
Single value giving the least mismatch if pos=FALSE, c(minMismatches,position) if pos=TRUE, if findAll==TRUE matrix with columns minMismatches, position and rows for each occurrence
Scott Sherrill-Mix R@sherrillmix.com
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.