indexOf | R Documentation |
indexOf
finds indices of value(s) in a given vector.
sealso<< regexpr
indexOf(x, v, regexp = TRUE)
x |
value(s) to be searched for in vector |
v |
vector |
regexp |
If |
Tomas Sieger
# numeric examples
indexOf(1,c(2,3,1,4))
indexOf(10,c(2,3,1,4))
# character examples
indexOf(c('a','b'),c('a','c','b','d','ab'))
# using regular expressions (enabled by default):
indexOf(c('a.*','b'),c('a','c','b','d','ab'))
# disabling regular expressions:
indexOf(c('a*','b'),c('a','c','b','d','ab'),regexp=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.