View source: R/helper_strsplit2.R
strsplit2 | R Documentation |
Extension of strsplit(). Makes it possible to split lines before or after a pattern match without removing the pattern.
strsplit2(x, split, type = "remove", perl = FALSE)
x |
text string to process. |
split |
pattern to split text at. |
type |
one out of c("remove", "before", "after"). |
perl |
Logical. If TRUE uses perl expressions. |
A list of the same length as x, the i-th element of which contains the vector of splits of x[i].
x<-"This is some text, where text is the split pattern of the text."
strsplit2(x,"text","after")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.