Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

RSProjection

Random Skewers projection


Description

Uses Bayesian posterior samples of a set of covariance matrices to identify directions of the morphospace in which these matrices differ in their amount of genetic variance.

Usage

RSProjection(cov.matrix.array, p = 0.95, num.vectors = 1000)

PlotRSprojection(rs_proj, cov.matrix.array, p = 0.95, ncols = 5)

Arguments

cov.matrix.array

Array with dimentions traits x traits x populations x MCMCsamples

p

significance treashhold for comparison of variation in each random direction

num.vectors

number of random vectors

rs_proj

output from RSProjection

ncols

number of columns in plot

Value

projection of all matrices in all random vectors

set of random vectors and confidence intervals for the projections

eigen decomposition of the random vectors in directions with significant differences of variations

References

Aguirre, J. D., E. Hine, K. McGuigan, and M. W. Blows. "Comparing G: multivariate analysis of genetic variation in multiple populations." Heredity 112, no. 1 (2014): 21-29.

Examples

library(magrittr)
# small MCMCsample to reduce run time, acctual sample should be larger 
data(dentus)
cov.matrices = dlply(dentus, .(species), function(x) lm(as.matrix(x[,1:4])~1)) %>% 
               laply(function(x) BayesianCalculateMatrix(x, samples = 50)$Ps)
cov.matrices = aperm(cov.matrices, c(3, 4, 1, 2))
## Not run: 
rs_proj = RSProjection(cov.matrices, p = 0.8)  
PlotRSprojection(rs_proj, cov.matrices, ncol = 5)

## End(Not run)

evolqg

Tools for Evolutionary Quantitative Genetics

v0.2-8
MIT + file LICENSE
Authors
Ana Paula Assis, Diogo Melo, Edgar Zanella, Fabio Andrade Machado, Guilherme Garcia
Initial release
2020-11-14

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.