deckel: treshold an array from below and above

Description Usage Arguments Details Value Author(s) Examples

View source: R/addons.R

Description

treshold an array from below and above

Usage

1
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 <[email protected]>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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/pace documentation built on Nov. 18, 2017, 7:51 a.m.