driftsel: Multivariate test for between-population selection

View source: R/driftsel.R

driftselR Documentation

Multivariate test for between-population selection

Description

Tests for the presence of directional and stabilizing selection on multivariate traits for a multi-population dataset.

Usage

driftsel(G, means, theta, anc = NULL, verbose = TRUE, parallel = FALSE)

Arguments

G

Genetic additive among-trait covariance matrix for k number of traits. Can be either a single kxk matrix, a list of multiple Gs or three-dimensional array (kxkxi), with i being the number of items.

means

matrix containing the means/fixed effects of all k characters for each population (n). Can be either a single nxk matrix, a list of multiple nxk matrices or a three-dimensional array (nxkxi). Must match the dimensionality of G.

theta

The coancestry coefficient among populations. Can be either a single nxn matrix, a list of nxn matrices of a three-dimensional array (nxnxi).

anc

matrix containing the ancestral state of all k characters. Can be either a single nxk matrix, a list of multiple nxk matrices or a three-dimensional array (nxkxi). Must match the dimensionality of G. If not provided, the ancestral state is assumed to be 0 for all traits.

parallel

Should be parallelized? Default is FALSE.

Verbose

logical. If TRUE, calculate the mahalanobis distance for each population based on the expected divergence.

Value

If nsim=0 returns a single value for the parametric S-test. If nsim>0 returns a non-parametric S-test value for each population.

Author(s)

Fabio Andrade Machado


FabioLugar/mvEvol documentation built on Dec. 21, 2024, 7:25 p.m.