Description Usage Arguments Details Value See Also Examples
A convenience function. Calls either
stri_count_regex
,
stri_count_fixed
, or
stri_count_charclass
, depending on the
argument used.
1 | stri_count(str, ..., regex, fixed, charclass)
|
str |
character vector of strings to search in |
... |
additional arguments passed to the underlying functions |
regex |
character vector; regular expressions |
fixed |
character vector; fixed patterns |
charclass |
character vector; identifiers of character classes |
Unless you are very lazy, please call the underlying functions directly for better performance.
Returns an integer vector.
Other search_count: stri_count_charclass
;
stri_count_fixed
;
stri_count_regex
;
stringi-search
1 2 3 4 5 6 | ## Not run:
s <- "Lorem ipsum dolor sit amet, consectetur adipisicing elit."
stri_count(s, fixed=letters)
stri_count(s, regex="[[:alpha:]]")
## End(Not run)
|
[1] 2 0 3 2 5 0 1 0 7 0 0 2 3 2 4 2 0 3 4 5 2 0 0 0 0 0
[1] 48
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.