splt_dat: Split the character to data.frame

View source: R/splt_dat.R

splt_datR Documentation

Split the character to data.frame

Description

Split the character to data.frame

Usage

splt_dat(x, splt, lab)

Arguments

x

vector

splt

character. as an argument of 'split' for 'strsplit'

lab

logical.

Examples

## Not run: 

# examples
x <- paste(LETTERS[1:5], letters[1:5], 1:5, sep="_")
splt_dat(x,"_", c("x","y","z"))

# A list have different length of splitted elements
x1 <- c("xxx;yyy", "xyx", "xxy;yyx;xxz")
x2 <- setNames(x1, letters[1:3])
splt_dat(x1, ";")
splt_dat(x2, ";")
splt_dat(x2, ";", c("v","idx"))

# A Named lists have different lengths for split elements.
equas <- rskodat::react_equas_ko
x <- equas$KOids[1:10] %>% setNames(., equas$Rid[1:10])
res <- splt_dat(x, ";", c("Kid", "Rid"))
split(res, res$Rid)


## End(Not run)

shkonishi/rsko documentation built on Feb. 21, 2023, 5:12 a.m.