plot_factor_cor: Plot correlation matrix between latent factors

Description Usage Arguments Details Value Examples

View source: R/plot_factors.R

Description

Function to plot the correlation matrix between the latent factors.

Usage

1
plot_factor_cor(object, method = "pearson", ...)

Arguments

object

a trained MOFA object.

method

a character indicating the type of correlation coefficient to be computed: pearson (default), kendall, or spearman.

...

arguments passed to corrplot

Details

This method plots the correlation matrix between the latent factors.
The model encourages the factors to be uncorrelated, so this function usually yields a diagonal correlation matrix.
However, it is not a hard constraint such as in Principal Component Analysis and correlations between factors can occur, particularly with large number factors.
Generally, correlated factors are redundant and should be avoided, as they make interpretation harder. Therefore, if you have too many correlated factors we suggest you try reducing the number of factors.

Value

Returns a symmetric matrix with the correlation coefficient between every pair of factors.

Examples

1
2
3
4
5
6
# Using an existing trained model on simulated data
file <- system.file("extdata", "model.hdf5", package = "MOFA2")
model <- load_model(file)

# Plot correlation between all factors
plot_factor_cor(model)

MOFA2 documentation built on Nov. 8, 2020, 7:28 p.m.