whichAeqB | R Documentation |
Return which(A %in% B) if it has length 1; give an error message otherwise.
whichAeqB(A, B, errNoMatch='no match',
err2Match='more than one match')
A |
A vector which may have a single match in |
B |
A vector of possible matches for |
errNoMatch |
a character string: error message if no match found. |
err2Match |
a character string: error message if multiple matches found. |
a single integer giving the index of the match in A
.
Spencer Graves
interpPairs
a2b <- whichAeqB(letters, 'b')
all.equal(a2b, 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.