removeNArows: Remove rows containing NAs

View source: R/preProcessMethMats.R

removeNArowsR Documentation

Remove rows containing NAs

Description

Function to remove all rows from a matrix where more than a certain fraction of the positions in that row are NAs. To remove rows with any NAs at all, set maxNAfraction=0

Usage

removeNArows(dataMatrix, maxNAfraction = 0.2, removeAll0 = F)

Arguments

dataMatrix

A matrix of numbers and NAs.

maxNAfraction

Maximual fraction of CpG/GpC positions that can be undefined (default=0.2)

removeAll0

Remove reads that only have 0 or NA values, i.e. were not methylated at all (default=F)

Value

A matrix without the rows where the fraction of NA positions is above the threshold

Examples

removeNArows(matrix(c(1,2,3,NA,4,5),nrow=3,byrow=TRUE))

jsemple19/EMclassifieR documentation built on Aug. 12, 2022, 2:57 p.m.