strSplit | R Documentation |
This function splits a character vector into a matrix based on a specified delimiter. It can handle both finite and infinite splits.
strSplit(x, split, fixed = TRUE, n = Inf)
x |
A character vector to be split |
split |
A character string specifying the delimiter |
fixed |
A logical value indicating whether the delimiter should be treated as a fixed string |
n |
An integer specifying the maximum number of splits to be performed |
A matrix where each row represents a split element
strSplit("Hello,World", ",")
# Output:
# [,1] [,2]
# [1,] "Hello" "World"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.