powered by
This function provides flexible checking if a set of columns may be extracted from a matrix or data.frame 'x'.
extrColsDeX(x, extrCol, doExtractCols = FALSE, callFrom = NULL, silent = FALSE)
(matrix or data.frame) min input
(character or integer) columns to be extracted, may be column-names or column index
(logical) if default FALSE only the column indexes will be returned
FALSE
(character) allows easier tracking of message(s) produced
(logical) suppress messages
integer-vector (ifdoExtractCols=FALSE return depending on input matrix or data.frame)
doExtractCols=FALSE
matrix
data.frame
read.table, filterList
read.table
filterList
# NOT RUN { dFr <- data.frame(a=11:14,b=24:21,cc=LETTERS[1:4],dd=rep(c(TRUE,FALSE),2)) extrColsDeX(dFr,c("b","cc","notThere")) extrColsDeX(dFr,c("b","cc","notThere"),doExtractCols=TRUE) # }
Run the code above in your browser using DataLab