View source: R/string_occurs.R
string_occurs | R Documentation |
This function searches for text within one or more phrases. Text to look for will be grouped into values that are found and not found.
string_occurs(dict_list, haystack, ignore.case = TRUE, nClust = 2)
dict_list |
character vector; value(s) to find |
haystack |
character vector; phrase(s) where values may exist |
ignore.case |
logical; indicates if spelling case matters, defaulting to ‘TRUE’ |
nClust |
Number of CPU cores to use, if available. This requires the ‘parallel’ package. |
list with two elements, ‘TRUE’ and ‘FALSE’, representing values that are found or not found within the phrase to search.
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_occurs(c('kings','quick','couth','brown'), c(note1, note2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.