bind | R Documentation |
This convenience function wraps left and right boundaries of each element of
a character vector. The default is to use "\b"
for left and right
boundaries.
bind(
...,
left = "\\b",
right = left,
dictionary = getOption("regex.library")
)
left |
A single length character vector to use as the left bound. |
right |
A single length character vector to use as the right bound. |
dictionary |
A dictionary of canned regular expressions to search within. |
... |
Regular expressions to add grouping parenthesis to a named
expression from the default regular expression dictionary prefixed with
single at ( |
Returns a character vector.
paste0
bind(LETTERS, "[", "]")
## More useful default parameters/usage
x <- c("Computer is fun. Not too fun.", "No it's not, it's dumb.",
"What should we do?", "You liar, it stinks!", "I am telling the truth!",
"How can we be certain?", "There is no way.", "I distrust you.",
"What are you talking about?", "Shall we move on? Good then.",
"I'm hungry. Let's eat. You already?")
Fry25 <- c("the", "of", "and", "a", "to", "in", "is", "you", "that", "it",
"he", "was", "for", "on", "are", "as", "with", "his", "they",
"I", "at", "be", "this", "have", "from")
gsub(pastex(list(bind(Fry25))), "[[ELIM]]", x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.