| extrColsDeX | R Documentation |
This function provides flexible checking if a set of columns may be extracted from a matrix or data.frame 'x'.
If argument extrCol is list of character vectors, this allows to search among given options, the first matching name for each vector will be identified.
extrColsDeX(
x,
extrCol,
doExtractCols = FALSE,
silent = FALSE,
debug = FALSE,
callFrom = NULL
)
x |
(matrix or data.frame) main input (where data should be extracted from) |
extrCol |
(character, integer or list) columns to be extracted, may be column-names or column index; if is |
doExtractCols |
(logical) if default |
silent |
(logical) suppress messages |
debug |
(logical) display additional messages for debugging |
callFrom |
(character) allow easier tracking of messages produced |
This function returns an integer-vector (ifdoExtractCols=FALSE return depending on input matrix or data.frame)
read.table, filterList
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)
extrColsDeX(dFr, list(c("nn","b","a"), c("cc","a"),"notThere"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.