Learn R Programming

parafac4microbiome (version 1.1.2)

flipLoadings: Sign flip the loadings of many randomly initialized models to make consistent overview plots.

Description

Sign flip the loadings of many randomly initialized models to make consistent overview plots.

Usage

flipLoadings(models, X)

Value

models with sign flipped components where applicable.

Arguments

models

Output of parafac.

X

Input dataset of parafac modelling procedure.

Examples

Run this code
A = array(rnorm(108*2), c(108,2))
B = array(rnorm(100*2), c(100,2))
C = array(rnorm(10*2), c(10,2))
X = reinflateTensor(A, B, C)
models = parafac(X, 2, nstart=10, output="all", sortComponents=TRUE)
flippedModels = flipLoadings(models, X)

Run the code above in your browser using DataLab