Learn R Programming

mvMORPH (version 1.2.2)

pcaLoadings: 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, ...)

Value

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

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.

Author

J. Clavel, J. Joseph, P. Montoya

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).

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

Run this code
# \donttest{

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)
# }

Run the code above in your browser using DataLab