replaceMissing: Replace missing values with a constant.

Description Usage Arguments Value Author(s) Examples

View source: R/Functions.R

Description

A convenience function for replacing missing values with a (non-missing) constant.

Usage

1
replaceMissing(x, replaceWith)

Arguments

x

An atomic vector or array.

replaceWith

Value to replace missing entries in x. The default is FALSE for logical vectors, 0 for numeric vectors, and empty string "" for character vectors.

Value

x with missing data replaced.

Author(s)

Peter Langfelder

Examples

1
2
3
4
5
logVec = c(TRUE, FALSE, NA, TRUE);
replaceMissing(logVec)

numVec = c(1,2,3,4,NA,2)
replaceMissing(numVec)

nosarcasm/WGCNA documentation built on May 28, 2019, 1:01 p.m.