Description Usage Arguments Details Value Author(s) See Also Examples
This function allows the ability to count the occurences of a regular expresion or substring in a vector.
1 | count_when(vector, value)
|
vector |
The vector to count the occurances in |
value |
The string or regular expression to test each vector against |
count_when passes the values through string_detect
, so you can pass value
through regex
The count of ocurrences in vector
zekrom_vale
count_when
for using str_detect
to test a vector
count_if
for using conditions to test a vector
count_if
for counting using a dataframe or tibble, this has access to all columns
1 2 | count_when(c("1","2","b","c","Z"), "\w")
# Returns 3, counting the ones with letters
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.