Description Usage Arguments Value Note See Also Examples
View source: R/str_detect_tags.R
Similar to stringr's str_detect
except matches are determined by the
tag matching, i.e. substring matches. In this instance tags are taken to
mean unary bits of information (flags) delineated by a separator. It is often
convenient to place these tag in a single text field – thus this function to
see if they match.
1 | str_detect_tag(string, tags, sep = ",", ignore_case = TRUE)
|
string |
character vector with each element containing zero or more
tags separated by |
tags |
character; vector of one or more tags, can be PCRE |
sep |
character; single element (usually single character) separator
between tags in |
ignore_case |
logical whether to ignore case during matching ( Default: TRUE) Tags are matched using |
logical of the same length of score
indicating whether the
element of score contains ANY of the tags.
allow for leading/trailing white space
1 2 3 4 5 | string <- c( 'X', 'Y', 'Z', 'Y,Z' )
tags <- list( 'X', '(y)' )
str_detect_tag( string, tags ) # T, T, F, T
str_detect_tag( string, tags, ignore_case=FALSE ) # T, F, F, F
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.