SRD | R Documentation |
Based on Random Skewers technique, selection response vectors are expanded in direct and indirect components by trait and compared via vector correlations.
SRD(cov.x, cov.y, ...)
## Default S3 method:
SRD(cov.x, cov.y, iterations = 1000, ...)
## S3 method for class 'list'
SRD(cov.x, cov.y = NULL, iterations = 1000, parallel = FALSE, ...)
## S3 method for class 'SRD'
plot(x, matrix.label = "", ...)
cov.x |
Covariance matrix being compared. cov.x can be a matrix or a list. |
cov.y |
Covariance matrix being compared. Ignored if cov.x is a list. |
... |
additional parameters passed to other methods |
iterations |
Number of random vectors used in comparison |
parallel |
if TRUE computations are done in parallel. Some foreach back-end must be registered, like doParallel or doMC. |
x |
Output from SRD function, used in plotting |
matrix.label |
Plot label |
Output can be plotted using PlotSRD function
List of SRD scores means, confidence intervals, standard deviations, centered means e centered standard deviations
pc1 scored along the pc1 of the mean/SD correlation matrix
model List of linear model results from mean/SD correlation. Quantiles, interval and divergent traits
If input is a list, output is a symmetric list array with pairwise comparisons.
Diogo Melo, Guilherme Garcia
Marroig, G., Melo, D., Porto, A., Sebastiao, H., and Garcia, G. (2011). Selection Response Decomposition (SRD): A New Tool for Dissecting Differences and Similarities Between Matrices. Evolutionary Biology, 38(2), 225-241. doi:10.1007/s11692-010-9107-2
RandomSkewers
cov.matrix.1 <- cov(matrix(rnorm(30*10), 30, 10))
cov.matrix.2 <- cov(matrix(rnorm(30*10), 30, 10))
colnames(cov.matrix.1) <- colnames(cov.matrix.2) <- sample(letters, 10)
rownames(cov.matrix.1) <- rownames(cov.matrix.2) <- colnames(cov.matrix.1)
srd.output <- SRD(cov.matrix.1, cov.matrix.2)
#lists
m.list <- RandomMatrix(10, 4)
srd.array.result = SRD(m.list)
#divergent traits
colnames(cov.matrix.1)[as.logical(srd.output$model$code)]
#Plot
plot(srd.output)
## For the array generated by SRD(m.list) you must index the idividual positions for plotting:
plot(srd.array.result[1,2][[1]])
plot(srd.array.result[3,4][[1]])
## Not run:
#Multiple threads can be used with some foreach backend library, like doMC or doParallel
library(doMC)
registerDoMC(cores = 2)
SRD(m.list, parallel = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.