Pe: Polymorphic index for loci

Description Usage Arguments Value Examples

View source: R/pe.R

Description

This function returns the effective number of alleles in a sample.

Usage

1
Pe(x, ...)

Arguments

x

A set of locus objects either as a vector or within a data.frame.

...

Ignored (for consistency)

Value

The polymorphic index for the locus, sum(pi(1-pi)) as a numeric value or as a data.frame if multiple loci are passed.

Examples

1
2
3
4
5
locus <- c( locus(1:2), locus(c(1,1)), locus(c(2,2)), locus(2:3) )
Pe(locus)
locus2 <- c( locus(1:2), locus(c(1,1)), locus(c(2,2)), locus(2:3) )
df <- data.frame( locus, locus2 )
Pe(df)

MarianaLag/Mlag documentation built on Feb. 13, 2020, 12:30 a.m.