fixNAs: Replace NAs with another value

View source: R/fixNAs.R

fixNAsR Documentation

Replace NAs with another value

Description

Useful for coercing matrices into how bsseq is expecting the M matrix to be.

Usage

fixNAs(x, y = 0, sparseMatrix = FALSE)

Arguments

x

The matrix-like object containing NAs to fix

y

The value to replace the NAs with (DEFAULT: 0)

sparseMatrix

Make the result a Matrix object? (DEFAULT: FALSE)

Value

         x with no NAs (possibly a sparse Matrix)

Examples


  nom <- c(rep(c(1,4,NA,9,NA,NA,7,NA), 5))
  no_nas <- fixNAs(nom)


trichelab/biscuitEater documentation built on March 2, 2024, 6:57 p.m.