Description Usage Arguments Value Examples
Logical check of each element in a vector to determine if an element occurs within n preceding words.
1 | is.within_n_preceding_words(x, regex.term, n = 0)
|
x |
A vector of elements. |
regex.term |
A regular expression that represents a word or term. |
n |
A max number of words (defined as |
Returns a logical vector equal in length to x.
1 2 3 4 5 6 7 8 9 10 | x <- c(
"I like dogs and cats",
"I do not like robots though",
"Like I care."
)
is.within_n_preceding_words(x, "I", 0)
is.within_n_preceding_words(x, "I", 1)
is.within_n_preceding_words(x, "like", 4)
is.within_n_preceding_words(x, "[Ll]ike", 4)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.