Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

extrNumericFromMatr

Extract numeric part of matrix or data.frame


Description

extrNumericFromMatr 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.

Usage

extrNumericFromMatr(dat, trimToData = TRUE, silent = FALSE, callFrom = NULL)

Arguments

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

callFrom

(character) allow easier tracking of message(s) produced

Value

matrix of numeric data

Examples

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)

wrMisc

Analyze Experimental High-Throughput (Omics) Data

v1.5.4
GPL-3
Authors
Wolfgang Raffelsberger [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.