adjust_matrix: Remove rows with low variance and impute missing data

Description Usage Arguments Details Value Author(s) Examples

View source: R/utils.R

Description

Remove rows with low variance and impute missing data

Usage

1
adjust_matrix(m, sd_quantile = 0.05, max_na = 0.25)

Arguments

m

a numeric matrix.

sd_quantile

cutoff the quantile of standard variation. Rows with variance less than it are removed.

max_na

maximum NA rate in each row. Rows with NA rate larger than it are removed.

Details

The function uses impute.knn to impute missing data, then uses adjust_outlier to adjust outliers and removes rows with low standard variation.

Value

A numeric matrix.

Author(s)

Zuguang Gu <[email protected]>

Examples

1
2
3
4
5
m = matrix(rnorm(200), 10)
m[1, 1] = 1000
range(m)
m2 = adjust_matrix(m)
range(m2)

jokergoo/cola documentation built on Nov. 13, 2018, 1:22 p.m.