NormalizeMultiBlock: NormalizeMultiBlock

View source: R/NormalizeMultiBlock.R

NormalizeMultiBlockR Documentation

NormalizeMultiBlock

Description

Normalize all blocks from a MultiBlock object. The ranknorm transform is based on that from the RNOmni package (doi:10.1111/biom.13214).

Usage

NormalizeMultiBlock(
  MB,
  blocks = NULL,
  method = c("none", "auto", "mean", "pareto", "norm", "geometric", "ranknorm")[5],
  infinite.as.NA = FALSE,
  constant = 0,
  offset = 3/8,
  showWarning = TRUE
)

Arguments

MB

The MultiBlock object.

blocks

Blocks to normalize. A vector of integers or block names (optional; all blocks are processed when omitted).

method

Normalization method. One of: 'none' (no transformation beyond optional Inf-to-NA conversion), 'auto' (auto-scaling), 'mean' (mean-centering), 'pareto' (mean-centered and divided by the square root of the SD), 'norm' (mean-centered and divided by its Frobenius norm), 'geometric' (geometric mean scaling), 'ranknorm' (rank-based inverse normal transform). Default: 'norm'.

infinite.as.NA

If TRUE, Infinite values are converted to NA before normalization. The presence of NA or Inf values will cause ComDim to stop; use NAInfRemoveMultiBlock to handle them.

constant

For 'geometric': value added to each element before computing the geometric mean (useful when data contain zeros). Default: 0.

offset

For 'ranknorm': offset in the Blom-type transform. Default: 3/8 (Blom transform).

showWarning

If TRUE, warn when all-NA variables are discarded. Default: TRUE.

Value

The normalized MultiBlock object.

Examples

b1 <- matrix(rnorm(500), 10, 50)
b2 <- matrix(rnorm(800), 10, 80)
b2[c(2, 3, 5), c(1, 2, 3)] <- NA
mb <- MultiBlock(Data = list(b1 = b1, b2 = b2))
mb <- NormalizeMultiBlock(mb, method = "auto")

R.ComDim documentation built on May 13, 2026, 9:07 a.m.