View source: R/MakeComDimScoresTable.R
| MakeComDimScoresTable | R Documentation |
Creates a long (tidy) data frame with the global and/or local scores from a ComDim model, suitable for use with ggplot2.
MakeComDimScoresTable(
model,
blocks = NULL,
dim = NULL,
dim.ort = NULL,
include = c("Q.scores", "T.scores", "Q.scores.ort", "T.scores.ort")[1:2]
)
model |
The output from a ComDim analysis (a |
blocks |
The blocks from which local scores will be extracted. A vector of integers (block
indices) or block names. When omitted, all blocks are included. Only relevant when
|
dim |
Integer vector of predictive component indices to include. When omitted, all predictive components in the model are included. |
dim.ort |
Integer vector of orthogonal component indices to include. When |
include |
Character vector selecting which score types to include. Accepted values
(case-insensitive) are |
A long data frame with one row per sample–component–score-type combination, containing the following columns:
sample.idSample name (factor).
sample.id.numberInteger position of the sample (factor).
block.idBlock index, or "Global" / "Global.ort" for Q scores.
block.nameBlock name, or "Global" / "Global.ort" for Q scores (factor).
dimComponent number.
scores.typeOne of "Global", "Global.ort", "Local", or "Local.ort" (factor).
scores.type.dimConcatenation of scores type and component number, e.g. "Q.scores1" (factor).
valueScore value.
MakeComDimLoadingsTable, ComDim_PCA
b1 <- matrix(rnorm(500), 10, 50) # 10 rows and 50 columns
b2 <- matrix(rnorm(800), 10, 80) # 10 rows and 80 columns
mb <- MultiBlock(Data = list(b1 = b1, b2 = b2))
model <- ComDim_PCA(mb, ndim = 2)
tbl <- MakeComDimScoresTable(model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.