ss: Wrapper for string split and sapply

View source: R/ss.R

ssR Documentation

Wrapper for string split and sapply

Description

Given a pattern, it splits and returns the slot of interest.

Usage

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

Arguments

x

Passed to argument x of strsplit.

pattern

Passed to argument split of strsplit.

slot

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

...

Additional arguments passed to strsplit.

Value

A vector with the information extracted from x.

Author(s)

Andrew E Jaffe

Examples


## 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)

LieberInstitute/jaffelab documentation built on April 1, 2024, 7:26 a.m.