match.String | R Documentation |
Helper function to return a vector with string(s) matching the pattern(s). The function aims to match each pattern individually (in a loop), and returns an error if one of them has no match.
match.String(pattern = null, x, value = FALSE)
pattern |
String or vector with pattern(s) to match. |
x |
String or vector to search. |
value |
Boolean to retrieve the value. |
The function first attempts an exact match. When there are no exact matches it attempts to match a regular expression. The regular expression aims to match at the end of the input 'x'.
In case of multiple matches on the first result is returned. Depending on the 'value' a value or index is returned.
Vector with column numbers or names.
match.String(c("A", "b"), c("A", "B", "C")) returns [1] 1 2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.