pcLoadings: Plot the loadings from Principal Component Analysis (PCA) or...

pcaLoadingsR Documentation

Plot the loadings from Principal Component Analysis (PCA) or Probabilistic Phylogenetic Principal Component Analysis (P3CA)

Description

The function extracts and plot the PCs loadings obtained by p3ca or mvgls.pca to help interpreting P3CA or phylogenetic PCA.

Usage


pcaLoadings(object, ...)
  

Arguments

object

A PCA fit obtained by the p3ca or mvgls.pca function.

...

Further options. For instance, color is used to define the color ramp palette used for the plot (default is c('red','white','blue4')). The argument scale is used to scale the bubble plot (default is 3). The argument horizontal=TRUE (default) plot the PCs on the 'x' axis.

Details

The function will plot (using a bubble plot) the correlations (loadings) of each variable used in a P3CA to each of the "q" P3Cs axes obtained by p3ca function. This can be used to display main (evolutionary) changes associated with each P3Cs axes (see Montoya et al. 2026; Joseph et al. 2026).

Value

a plot showing the correlation (loadings) of each variable with each PC axis.

Author(s)

J. Clavel, J. Joseph, P. Montoya

References

Montoya P., Joseph J., Goswami A., Morlon H., Clavel J. 2026. A probabilistic and phylogenetic principal component analysis for modelling high-dimensional trait evolution. doi.org/10.64898/2026.05.27.728209.

Joseph J., Montoya P., Baudat F., Ruiz-Herrera A., Clavel J. 2026. Explaining the rapid evolution of mammalian meiotic recombination proteins. doi.org/10.64898/2026.06.01.729254.

See Also

p3ca, pcaShape, mvgls.pca

Examples



set.seed(2508)

# Loading the data
data(phyllostomid)
phyllos_data = phyllostomid$mandible[,-1]
phyllos_tree = phyllostomid$tree

# Perfoming the P3CA on the complete dataset - Analytical solution
p3ca_phyllos = p3ca(phyllos_data, phyllos_tree, q=5, model='BM')

# plot the loadings
pcaLoadings(p3ca_phyllos)

# Test with mvgls.pca()
fit <- mvgls(phyllos_data~1, tree=phyllos_tree, model="BM")
phypca <- mvgls.pca(fit)
pcaLoadings(phypca, q=5)


mvMORPH documentation built on Oct. 1, 2026, 5:08 p.m.