split_extract_fixed: stri_split and extract

View source: R/8_fit.R

nfactorsR Documentation

stri_split and extract

Description

stri_split and extract

Usage

nfactors(x, sep = guess_sep(x))

split_extract_fixed(x, sep, i)

split_extract_regex(x, sep, i)

split_extract(x, i, sep = guess_sep(x))

Arguments

x

character vector

sep

string

i

integer

Value

character vector

Examples

# Read
    file <- system.file('extdata/atkin.metabolon.xlsx', package = 'autonomics')
    object <- read_metabolon(file)
    x <- object$sample_id[1:5]
    nfactors(x)
# Split
    split_extract_fixed(x, '.', 1:2)
    split_extract_fixed(x, '.', seq_len(nfactors(x)-1))
    split_extract_fixed(x, '.', nfactors(x))
    split_extract_fixed(fdt(object)$PUBCHEM, ';', 1) # with NA values

bhagwataditya/autonomics documentation built on Nov. 1, 2024, 5:47 a.m.