check.nas {Pigengene}R Documentation

Removes NAs from a data matrix

Description

Checks Data for NA values.

Usage

  check.nas(Data, naTolerance=0.05, na.rm=TRUE)

Arguments

Data

A matrix or data frame containing the expression data, with genes corresponding to columns and rows corresponding to samples. Rows and columns must be named.

naTolerance

A number in the 0-1 range. If the frequency of NAs in a column of Data is more than this threshold , then that column will be removed.

na.rm

If TRUE, NAs in the Data will be replaces with the average of the column, however, if the frequency of NAs in the column is too high (i.e., more than naTolerance), the whole column will be removed.

Value

A list of:

cleaned

The cleaned data with no NA value. Rows are the same as Data, but some columns may be deleted.

tooNaGenes

A character vector of those genes (i.e., column names of Data) that had too many NAs, and therefore were removed.

replacedNaNum

The number of NA entries in the matrix that were replaced with the average of the corresponding column (gene).

Author(s)

Habil Zare

See Also

check.pigengene.input, Pigengene-package

Examples

     data(aml)
     dim(aml)
     aml[1:410]<-NA
     c1 <- check.nas(Data=aml)
     dim(c1$cleaned)
     c1$tooNaGenes
     rm(aml)

[Package Pigengene version 1.8.1 Index]