SplitRW: SplitRW - Building the RW list compatible with ComDim_PCA().

View source: R/SplitRW.R

SplitRWR Documentation

SplitRW - Building the RW list compatible with ComDim_PCA().

Description

To split a multi-block into a list containing smaller blocks, comprising each data from one batch.

Usage

SplitRW(
  MB = MB,
  checkSampleCorrespondence = FALSE,
  batchNormalisation = TRUE,
  showSampleCorrespondence = TRUE
)

Arguments

MB

The multi-block structure built with BuildMultiblock().

checkSampleCorrespondence

If FALSE, the same number of samples and the sample order are assumed for all the batches. If TRUE, only the samples found in all replicate blocks will be included in the final structure.

batchNormalisation

If TRUE, each RW block is divided by its norm and the square root of the number of replicates.

showSampleCorrespondence

If TRUE, print in the console a data frame with the sample correspondence across blocks.

Value

The list containing the multi-block composed of the replicate-blocks.

Examples

b1 = matrix(rnorm(500),10,50)
batch_b1 = rep(1,10)
b2 = matrix(rnorm(800),30,80)
batch_b2 = c(rep(1,10),rep(2,10),rep(3,10))
# Generate the multi-block (mb)
mb <- BuildMultiBlock(b1, batches = batch_b1)
mb <- BuildMultiBlock(b2, growingMB = mb, batches = batch_b2, equalSampleNumber = FALSE)
rw <- SplitRW(mb)

f-puig/R.ComDim documentation built on Feb. 20, 2024, 6:49 a.m.