Learn R Programming

qcrlscR (version 0.1.3)

mv.filter: Filtering variable based on the percentage of missing values

Description

This function calculates the percentage of missing values and keeps those features with missing values percentage less than the designed threshold.

Usage

mv.filter(x, thres = 0.3)

Value

a list of with contents:

  • dat the filtered data matrix

  • idx a logical vector of index for keeping features.

Arguments

x

a data matrix. The columns are features.

thres

threshold of missing values. Features less than this threshold will be kept. Value has to be between 0 and 1.

See Also

Other missing value processing: mv.filter.qc(), mv.perc()

Examples

Run this code
names(man_qc)
data <- man_qc$data
meta <- man_qc$meta
## check missing value rates
tail(sort(mv.perc(data)), 20)
## missing values filtering
tmp <- mv.filter(data, thres = 0.15)
data_f <- tmp$dat
## compare
dim(data_f)
dim(data)

Run the code above in your browser using DataLab