Learn R Programming

adegenet (version 2.1.10)

propTyped-methods: Compute the proportion of typed elements

Description

The generic function propTyped is devoted to investigating the structure of missing data in adegenet objects.

Methods are defined for genind and genpop objects. They can return the proportion of available (i.e. non-missing) data per individual/population, locus, or the combination of both in with case the matrix indicates which entity (individual or population) was typed on which locus.

Usage

# S4 method for genind
propTyped(x,  by=c("ind","loc","both"))
# S4 method for genpop
propTyped(x,  by=c("pop","loc","both"))

Value

A vector of proportion (when by equals "ind", "pop", or "loc"), or a matrix of binary data (when by equals "both")

Arguments

x

a genind and genpop object

by

a character being "ind","loc", or "both" for genind object and "pop","loc", or "both" for genpop object. It specifies whether proportion of typed data are provided by entity ("ind"/"pop"), by locus ("loc") or both ("both"). See details.

Author

Thibaut Jombart t.jombart@imperial.ac.uk

Details

When by is set to "both", the result is a matrix of binary data with entities in rows (individuals or populations) and markers in columns. The values of the matrix are 1 for typed data, and 0 for NA.

Examples

Run this code
if (FALSE) {
data(nancycats)
propTyped(nancycats,by="loc")
propTyped(genind2genpop(nancycats),by="both")
}

Run the code above in your browser using DataLab