rmnoise: Remove noise

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Sets value equal to zero if between given threshold bounderies

Usage

1
rmnoise(x, threshold, sign = FALSE)

Arguments

x

vector

threshold

vector length 1 or 2

logical

Default FALSE. If TRUE, negative and positive values are converted to +1 and -1 respectively

Value

vector

Examples

1
2
3
rmnoise(-3:3, threshold=2)                   # =c(-3, -2,  0, 0, 0, 2, 3)
rmnoise(-3:3, threshold=c(-1, 2))            # =c(-3, -2, -1, 0, 0, 2, 3)
rmnoise(-3:3, threshold=c(-1, 2), sign=TRUE) # =c(-1, -1, -1, 0, 0, 1, 1)

Oxylo/canaries documentation built on Oct. 30, 2019, 10:23 p.m.