data_filtering: Filters the data above the thresholds (set to zero)....

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Filters the data above the thresholds (set to zero). Thresholds can be a single value, or equal to the number of rows. If thresholds is set to NA, no thresholding happens.

Usage

1
data_filtering(data, thresholds = NA)

Arguments

data

Data to filter. Can be vector or matrix.

thresholds

Filtering thresholds. Defaults to NA but can be a mixture of NAs and numerical values (with length equal to nrow(data)).

Value

List of filtered data vector or matrix ($data) and binary matrix of filtered times (filter) (TRUE means filtered).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
n <- 10000
d <- 5
data <- matrix(rnorm(n * d), ncol = d)

# No filtering
data_filtering(data)

# Filtering everything
data_filtering(data, 0.0)
data_filtering(data, rep(0.0, d))

# Filtering only the first col
data_filtering(data, c(0.0, rep(NA, d - 1)))

ntwk documentation built on Sept. 13, 2021, 9:07 a.m.