View source: R/string_counts.R
string_counts | R Documentation |
This function counts occurrences of text within one or more phrases.
string_counts(strings, search_data, ignore.case = TRUE)
strings |
character vector; value(s) to find |
search_data |
character vector; phrase(s) where values may exist |
ignore.case |
logical; indicates if spelling case matters, defaulting to ‘TRUE’ |
list with two elements; ‘cntByTotal’ contains total occurrences and ‘cntByData’ contains occurrences for each element in ‘search_data’
note1 <- "I am the very model of a modern major general I've information vegetable, animal, and mineral I know the kings of England, and I quote the fights historical From marathon to Waterloo in order categorical; I'm very well acquainted, too, with matters mathematical, I understand equations both the simple and quadratical About binomial theorem I'm teeming with a lot o' news, With many cheerful facts about the square of the hypotenuse" note2 <- "The quick brown fox jumps over the lazy dog" string_counts(c('I','the','couth'), c(note1, note2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.