shuff_data: Calculate null distribution of difference in gene diversity...

Description Usage Arguments Value Examples

Description

Randomly permutes individuals between sample groups and calculates difference in gene diversity (Hs) between the two randomised groups. Used to generate null distribution of difference in gene diversity between two samples for permutation testing

Usage

1
shuff_data(data, reps = 100, bal.loci = TRUE)

Arguments

reps

Number of iterations to repeat the permutation. If not specified, defaults to 100.

bal.loci

Option to incorporate balancing of per-locus sample size into the permutation (see function bal_loci). When bal.loci = TRUE, each replicate of the permutation first balances sample sizes before gene diversity calculation is performed. When bal.loci = FALSE, sample balancing is skipped.

Value

A vector of values of length "reps". Each value represents the difference in gene diversity between two populations after individuals have been randomly permuted between the populations. This difference is calculated as Hs(pop2) - Hs(pop1).

Examples

1
test <- shuff_data(data = dat.sim, reps = 100, bal.loci = FALSE)

Daniel-J-Schmidt/genrich documentation built on May 6, 2019, 10:52 p.m.