multi_strsplit: For splitting strings using a vector of several possible...

Description Usage Arguments Value Note Author(s) Examples

View source: R/multi_strsplit.R

Description

An adaptation of the strsplit function, which is only able to take a single character string for its split argument (when fixed = TRUE).

Usage

1
multi_strsplit(x, splits)

Arguments

x

character vector, each element of which is to be split. Other inputs, including a factor, will give an error.

splits

character vector containing regular expressions to use for splitting.

Value

A character vector containing all characters in x that were split using splits.

Note

Applies fixed = TRUE to underlying strsplit function. See strsplit documentation for explanation of this argument.

Author(s)

Will Haese-Hill

Examples

1
2
3
x = c("a+b-c", "d*e/f")
multi_strsplit(x, splits=c('+', '-', '*', '/'))
# [1] "a" "b" "c" "d" "e" "f"

jgrevel/BAST1-R-Library documentation built on May 21, 2019, 10:11 a.m.