| variableNames<- | R Documentation |
Set the variable names of a MultiBlock object.
value must be a named list with one entry per block, where each
entry is a vector of variable names whose length matches the number of
columns in that block.
variableNames(x) <- value
## S4 replacement method for signature 'MultiBlock'
variableNames(x) <- value
x |
A MultiBlock object. |
value |
A named list of variable-name vectors, one per block. |
To update a single block, use standard list-replacement chaining:
variableNames(mb)[["b1"]] <- newNames
The updated MultiBlock object.
b1 <- matrix(rnorm(500), 10, 50)
b2 <- matrix(rnorm(800), 10, 80)
mb <- MultiBlock(Data = list(b1 = b1, b2 = b2))
# Replace all at once:
variableNames(mb) <- list(
b1 = paste0("v", 1:50),
b2 = paste0("v", 1:80)
)
# Replace a single block using chaining:
variableNames(mb)[["b1"]] <- paste0("feat_", 1:50)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.