deckel: treshold an array from below and above

View source: R/addons.R

deckelR Documentation

treshold an array from below and above

Description

treshold an array from below and above

Usage

deckel(x, lower = -Inf, upper = +Inf)

Arguments

x

numeric matrix

lower

numeric

upper

numeric

Details

The function takes the matrix and censores the values from below (if lower param is set) or from above (if upper param is set), or from both of them. If neither lower nor upper param is set or if none of the values meet the criteria for thresholding, then function returns unmodified object.

Value

matrix

Author(s)

Wolfgang Huber <wolfgang.huber@embl.de>

Examples

mat = matrix(1:40, nrow=5)

# threshold values below 5
deckel(mat, lower=5)

# threshold values above 15
deckel(mat, upper=15)

# threshold values below 5 and above 15
deckel(mat, lower=5, upper=15)

# threshold values below 0 and above 50 -> no thresholding will be done!
identical(mat, deckel(mat, lower=0, upper=50))

MalgorzataOles/BloodCancerMultiOmics2017 documentation built on March 29, 2024, 2:29 p.m.