Z.clean.up {widals} | R Documentation |
Clean Data
Description
A crude, brute-force way to destroy bad values in data.
Usage
Z.clean.up(Z)
Arguments
Z |
Data. A |
Details
This function replaces intractable values, e.g., NA
, or -Inf
, in data, with the global mean.
Value
A \tau
x n
numeric matrix.
Examples
tau <- 10
n <- 7
Z <- matrix(1, tau, n)
Z[2,4] <- -Inf
Z[3,4] <- Inf
Z[4,4] <- NA
Z[5,4] <- log(-1)
Z
Z.clean.up(Z)
## The function is currently defined as
function (Z)
{
Z[Z == Inf | Z == -Inf] <- NA
Z[is.na(Z) | is.nan(Z)] <- mean(Z, na.rm = TRUE)
return(Z)
}
[Package widals version 0.6.1 Index]