replaceMissing: Replace missing values with a constant.

View source: R/Functions.R

replaceMissingR Documentation

Replace missing values with a constant.

Description

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

Usage

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

logVec = c(TRUE, FALSE, NA, TRUE);
replaceMissing(logVec)

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


WGCNA documentation built on Sept. 18, 2024, 5:08 p.m.

Related to replaceMissing in WGCNA...