View source: R/NAInfRemoveMultiBlock.R
| NAInfRemoveMultiBlock | R Documentation |
Remove NA and Infinite values from a MultiBlock object in a single pass.
Variables whose combined count of NA and Infinite values meets or exceeds
minfrac * nrow are discarded first. Remaining Infinite values are
then replaced according to inf.method; remaining NA values are
imputed according to na.method.
NAInfRemoveMultiBlock(
MB,
blocks = NULL,
minfrac = 0.5,
na.method = c("none", "zero", "median", "discard", "fixed.value", "fixed.value.all",
"fixed.noise", "random.noise", "QRILC")[8],
inf.method = c("none", "fixed.noise", "random.noise")[3],
constant = 0,
factor.NA = 0.5,
sd.noise = 0.3,
tune.sigma = 1,
showWarning = TRUE
)
MB |
The MultiBlock object. |
blocks |
Blocks to process: a vector of integers or block names (optional; all blocks are processed when omitted). |
minfrac |
Minimum fraction of valid (non-NA, finite) values required to retain a variable. Variables at or below this threshold are discarded. Default: 0.5. |
na.method |
Imputation method for remaining NA values after the
minfrac filter. One of: |
inf.method |
Replacement method for remaining Infinite values after
the minfrac filter. One of: |
constant |
For |
factor.NA |
Noise factor used by |
sd.noise |
Standard-deviation factor for |
tune.sigma |
Tuning scalar for |
showWarning |
If |
The processed MultiBlock object.
b1 <- matrix(rnorm(500), 10, 50)
b2 <- matrix(rnorm(800), 10, 80)
b2[c(2, 3, 5), c(1, 2, 3)] <- NA
b2[c(1, 4), c(4, 5)] <- Inf
mb <- MultiBlock(Data = list(b1 = b1, b2 = b2))
mb <- NAInfRemoveMultiBlock(mb, na.method = "zero", inf.method = "fixed.noise")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.