Learn R Programming

ntwk (version 1.0.0)

data_filtering: 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.

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

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

Run this code
# NOT RUN {
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)))
# }

Run the code above in your browser using DataLab