strsplitx: Extended string splitting

View source: R/utils.r

strsplitxR Documentation

Extended string splitting

Description

Can be used as a substitute of the base function. Main claim to fame is easing the split around the defined delimiter, see example.

Usage

strsplitx(x, split, type = "classic", perl = FALSE, ...)

Arguments

x

data

split

delimiter

type

Split type. Can be c("classic", "before", "after", "around")

perl

perl param from strsplit()

...

additional parameters are passed to base strsplit handling splits

Value

list

Examples

test <- c("12 months follow-up", "3 steps", "mRS 6 weeks",
"Counting to 231 now")
strsplitx(test, "[0-9]", type = "around")

REDCapCAST documentation built on April 4, 2025, 3:18 a.m.