firstmatch | R Documentation |
firstmatch
seeks matches for the elements of its first argument among those of its second,
for details see base::charmatch()
. charmatch
returns a zero if multiple matches are found, whereas firstmatch
returns the first partial match if multiple matches are found.
firstmatch(x, table, nomatch = NA_integer_)
x |
character: the values to be matched; converted to a character vector if necessary |
table |
character: the values to be matched against; converted to a character vector if necessary |
nomatch |
integer: the value to be returned at non-matching positions (default: |
integer
firstmatch("d", c("chisq", "cauchy"))
charmatch("c", c("chisq", "cauchy"))
firstmatch("c", c("chisq", "cauchy"))
firstmatch("ca", c("chisq", "cauchy"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.