| str.split | R Documentation |
Splits string vectors
## S3 method for class 'split' str(str, pattern, first = FALSE, keep.match = FALSE, ...)
str |
a vector of strings |
pattern |
vector where splits take place |
A list with same length as str. Each list element i contains the split substrings from str[i]
## Not run:
str = "Hi\n\nyou!"
str.split(str,"\n", keep.match=!TRUE)
str <- c("aes_afe_f", "qwe.rty", "yui0op[3", "b")
#split x on the letter e
str
str.split(str, "e", keep.match=TRUE)
str.split(str, "e", first=TRUE, keep.match=TRUE)
str = c("aes_afe_fe")
ignore.pos = cbind(1,3)
str.split(str, "e", keep.match=TRUE, ignore.pos=ignore.pos)
str.split(str, "e", first=TRUE,keep.match=TRUE, ignore.pos=ignore.pos)
str = "abscde3823nsd34"
str.split(str, "[a-z]*", fixed=FALSE, keep.match=TRUE)
str.split(str, c("[a-z]*","d"), fixed=FALSE, keep.match=TRUE)
str = c("abscde3823nsd34","8748274")
str.split(str, c("[a-z]*","d"), fixed=FALSE, keep.match=TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.