Learn R Programming

poppr (version 1.0.1)

bruvo.dist: Calculate the average Bruvo's Distance over all loci in a population.

Description

Calculate the average Bruvo's Distance over all loci in a population.

Usage

bruvo.dist(pop, replen = c(2))

Arguments

pop
a genind object
replen
a vector of integers indicating the length of the nucleotide repeats for each microsatellite locus.

Value

  • a distance matrix

See Also

nancycats

Examples

Run this code
# Please note that the data presented is assuming that the nancycat dataset
# contains all dinucleotide repeats, it most likely is not an accurate
# representation of the data.

# Load the nancycats dataset and construct the repeat vector.
data(nancycats)
ssr <- rep(2, 9)

# Analyze the 1st population in nancycats

bruvo.dist(popsub(nancycats, 1), replen = ssr)

# View each population as a heatmap.
sapply(nancycats$pop.names, function(x)
heatmap(as.matrix(bruvo.dist(popsub(nancycats, x), replen = ssr)), symm=TRUE))

Run the code above in your browser using DataLab