% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/NAInfRemoveMultiBlock.R
\name{NAInfRemoveMultiBlock}
\alias{NAInfRemoveMultiBlock}
\title{NAInfRemoveMultiBlock}
\usage{
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
)
}
\arguments{
\item{MB}{The MultiBlock object.}

\item{blocks}{Blocks to process: a vector of integers or block names
(optional; all blocks are processed when omitted).}

\item{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.}

\item{na.method}{Imputation method for remaining NA values after the
minfrac filter. One of: \code{'none'} (keep NAs), \code{'zero'},
\code{'median'}, \code{'discard'} (drop columns still containing NAs),
\code{'fixed.value'}, \code{'fixed.value.all'}, \code{'fixed.noise'},
\code{'random.noise'}, \code{'QRILC'}. Default: \code{'random.noise'}.}

\item{inf.method}{Replacement method for remaining Infinite values after
the minfrac filter. One of: \code{'none'} (keep Inf),
\code{'fixed.noise'}, \code{'random.noise'}.
Default: \code{'random.noise'}.}

\item{constant}{For \code{na.method = 'fixed.value'}: value to replace NAs.
For \code{na.method = 'fixed.value.all'}: value added to every element
(NAs are then set to this value). Default: 0.}

\item{factor.NA}{Noise factor used by \code{'fixed.noise'} and
\code{'random.noise'} for both NA and Inf imputation. For NA and -Inf:
the replacement mean equals \code{col_min * factor.NA}. For +Inf:
\code{col_max / factor.NA}. Default: 0.5.}

\item{sd.noise}{Standard-deviation factor for \code{'random.noise'}:
\code{SD = abs(mean * sd.noise)}. Default: 0.3.}

\item{tune.sigma}{Tuning scalar for \code{na.method = 'QRILC'}. Default:
1 (Gaussian complete-data assumption).}

\item{showWarning}{If \code{TRUE}, emit a warning when variables are
discarded by the minfrac filter. Default: \code{TRUE}.}
}
\value{
The processed MultiBlock object.
}
\description{
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
\code{minfrac * nrow} are discarded first. Remaining Infinite values are
then replaced according to \code{inf.method}; remaining NA values are
imputed according to \code{na.method}.
}
\examples{
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")
}
