strSplit: Split a character vector into a matrix based on a delimiter

View source: R/utils-split.R

strSplitR Documentation

Split a character vector into a matrix based on a delimiter

Description

This function splits a character vector into a matrix based on a specified delimiter. It can handle both finite and infinite splits.

Usage

strSplit(x, split, fixed = TRUE, n = Inf)

Arguments

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

Value

A matrix where each row represents a split element

Examples

strSplit("Hello,World", ",")
# Output:
#      [,1]    [,2]   
# [1,] "Hello" "World"


bhklab/AnnotationGx documentation built on April 3, 2025, 4:27 p.m.