View source: R/extrNumericFromMatr.R
| extrNumericFromMatr | R Documentation |
This function extracts numeric part of matrix or data.frame, removing remaining non-numeric elements if trimToData is set to TRUE.
Note, that cropping entire lines where a (single) text element appeared may quickly reduce the overal content of the input data.
extrNumericFromMatr(
dat,
trimToData = TRUE,
silent = FALSE,
debug = FALSE,
callFrom = NULL
)
dat |
matrix (or data.frame) for extracting numeric parts |
trimToData |
(logical) default to remove (crop) lines and cols contributing to NA, non-numeric data is transfomed to NA |
silent |
(logical) suppress messages |
debug |
(logical) additional messages for debugging |
callFrom |
(character) allow easier tracking of message(s) produced |
This function reurns a matrix of numeric data
mat <- matrix(c(letters[1:7],14:16,LETTERS[1:6]),nrow=4,dimnames=list(1:4,letters[1:4]))
mat; extrNumericFromMatr(mat)
mat <- matrix(c(letters[1:4],1,"e",12:19,LETTERS[1:6]),nr=5,dimnames=list(11:15,letters[1:4]))
mat; extrNumericFromMatr(mat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.