dot-splitDFbyVectorList: select data.frame by row

Description Usage Arguments Value Examples

Description

Internal function to be used by mapply for splitting a data.frame/data.table by row using a vector of index values

Usage

1
.splitDFbyVectorList(df, vectorList)

Arguments

df

a data frame to be split by row index

vectorList

rows to return

Value

retuns a data.frame/data.table subset

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
dat <- data.frame(col1 = c(1:10), col2 = c(21:30))
vecList <- list(c(1:3), c(6:8), c(1:5))
split.dat <- mapply(FUN = .splitDFbyVectorList,
                   vectorList = vecList,
                   MoreArgs = list(dat),
                   SIMPLIFY = FALSE)

## End(Not run)

pmbrophy/mzDataTable documentation built on June 6, 2020, 7:43 a.m.