| AddMetadata | R Documentation |
Adds or overwrites batch and/or metadata information for one or more blocks of an existing MultiBlock object.
AddMetadata(MB, block = NULL, batches = NULL, metadata = NULL)
MB |
A MultiBlock object. |
block |
The name of the block to modify (character). If |
batches |
A numeric vector of batch labels, one per sample in the target block. Replaces any existing Batch entry for that block. |
metadata |
A data.frame with one row per sample in the target block. Replaces any existing Metadata entry for that block. |
The updated MultiBlock.
MultiBlock, FilterSamplesMultiBlock
b1 <- matrix(rnorm(500), 10, 50) # 10 samples, 50 variables
b2 <- matrix(rnorm(800), 10, 80) # 10 samples, 80 variables
batch_b1 <- rep(1, 10)
meta_b1 <- data.frame(condition = rep(c("A", "B"), 5))
mb <- MultiBlock(Data = list(b1 = b1, b2 = b2))
# Add batch information to block 'b1':
mb <- AddMetadata(mb, block = "b1", batches = batch_b1)
# Add (or overwrite) metadata for block 'b1':
mb <- AddMetadata(mb, block = "b1", metadata = meta_b1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.