Z.clean.up | R Documentation |
A crude, brute-force way to destroy bad values in data.
Z.clean.up(Z)
Z |
Data. A |
This function replaces intractable values, e.g., NA
, or -Inf
, in data, with the global mean.
A \tau
x n
numeric matrix.
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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.