var_filter: Filtering variable based on variability

View source: R/mt_extra.R

var_filterR Documentation

Filtering variable based on variability

Description

Perform variable filtering based on feature variability measurement such as standard deviation(SD) and inter-quantile range(IQR).

Usage

var_filter(x, method = "IQR", na.rm = FALSE, thres = 0.25)

Arguments

x

a matrix or data frame.

method

variability measurement method, such as IQR and sd.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

thres

a numeric value between 0 and 1 for the threshold of quantile. Features whose variability value is large than this threshold will be kept.

Value

a list of with contents:

  • dat the filtered data matrix

  • idx a vector of filtering index.

See Also

Other variable filters: blank_filter(), locfdr_filter(), mv_filter(), qc_filter(), rsd_filter()

Examples

set.seed(100)
x <- matrix(rnorm(20 * 10), ncol = 10)
res <- var_filter(x, method = "sd", thres = 0.25)
sum(res$idx)

wanchanglin/mtExtra documentation built on Aug. 2, 2024, 5:47 p.m.