MakeComDimLoadingsTable: MakeComDimLoadingsTable

View source: R/MakeComDimLoadingsTable.R

MakeComDimLoadingsTableR Documentation

MakeComDimLoadingsTable

Description

Creates a long (tidy) data frame with the local P-loadings from a ComDim model, suitable for use with ggplot2.

Usage

MakeComDimLoadingsTable(model, blocks = NULL, dim = NULL, dim.ort = NULL)

Arguments

model

The output from a ComDim analysis (a ComDim object).

blocks

The blocks from which loadings will be extracted. A vector of integers (block indices) or block names. When omitted, all blocks are included.

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 NULL, all orthogonal components present in the model are included. When 0, no orthogonal components are included.

Value

A long data frame with one row per variable–component combination, containing the following columns:

variable.id

Variable name (factor).

variable.id.number

Position of the variable across all blocks (factor).

block.id

Integer index of the block.

block.name

Name of the block (factor).

dim

Component number.

value

Loading value (from P.loadings or Orthogonal$P.loadings.ort).

See Also

MakeComDimScoresTable, ComDim_PCA

Examples

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 <- MakeComDimLoadingsTable(model)

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