ss: Wrapper for string split and sapply

Description Usage Arguments Value Author(s) Examples

View source: R/ss.R

Description

Wrapper for string split and sapply

Usage

1
ss(x, pattern, slot = 1, ...)

Arguments

x

Passed to argument 'x' of [strsplit][base::strsplit].

pattern

Passed to argument 'split' of [strsplit][base::strsplit].

slot

An integer specifying which element of the resulting list to return.

...

Additional arguments passed to [strsplit][base::strsplit].

Value

A vector with the information extracted from 'x'.

Author(s)

Andrew E Jaffe

Examples

1
2
3
4
5
6
7
## Some example info with two variables separated by a _
info <- c('DLPFC_polyA', 'DLPFC_RiboZero')
ss(info, '_', 1)
ss(info, '_', 2)

## Example where we use the ... argument
ss('a.b.c', '.', slot = 1, fixed = TRUE)

blackthornrx/rbnctools documentation built on Feb. 6, 2021, 12:27 a.m.