| pcaLoadings | R Documentation |
The function extracts and plot the PCs loadings obtained by p3ca or mvgls.pca to help interpreting P3CA or phylogenetic PCA.
pcaLoadings(object, ...)
object |
A PCA fit obtained by the |
... |
Further options. For instance, |
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).
a plot showing the correlation (loadings) of each variable with each PC axis.
J. Clavel, J. Joseph, P. Montoya
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.
p3ca,
pcaShape,
mvgls.pca
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.