ezSplit: Separates a character vector into a matrix by splitting it.

View source: R/util.R

ezSplitR Documentation

Separates a character vector into a matrix by splitting it.

Description

The split vector needs to divide the x vector into pieces of equal lengths. The split is removed from the original input.

Usage

ezSplit(x, split, ...)

Arguments

x

the character vector to be split element-wise.

split

a character vector defining with what to split.

...

additional arguments to be passed to strsplit().

Value

Returns a matrix containing the split vector and x as the rownames.

Author(s)

Rehrauer, Hubert

Schmid, Peter

See Also

strsplit

Examples

ezSplit(letters[1:5], "b")
ezSplit(rep("abcde", 4), letters[1:4])

uzh/ezRun documentation built on April 24, 2024, 4:01 p.m.