check.nas: Removes 'NA's from a data matrix

Description Usage Arguments Value Author(s) See Also Examples

View source: R/check.nas.R

Description

Checks Data for NA values.

Usage

1
  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

1
2
3
4
5
6
7
     data(aml)
     dim(aml)
     aml[1:410]<-NA
     c1 <- check.nas(Data=aml)
     dim(c1$cleaned)
     c1$tooNaGenes
     rm(aml)

Pigengene documentation built on Nov. 8, 2020, 6:47 p.m.