Pe: Polymorphic index for loci

View source: R/pe.R

PeR Documentation

Polymorphic index for loci

Description

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

Usage

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

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)

dyerlab/gstudio documentation built on Feb. 2, 2024, 8:24 p.m.