pegas (version 1.3)

na.omit.loci: Missing Allelic Data

Description

The first function is a method of the generic function na.omit.

nullAlleles2NA changes all genotypes with at least one `null' allele (that is among the values in na.alleles) into NA.

Usage

# S3 method for loci
na.omit(object, na.alleles = c("0", "."), ...)

nullAlleles2NA(object, na.alleles = c("0", "."))

Value

an object of class "loci".

Arguments

object

an object of class "loci".

na.alleles

a vector of character strings giving the alleles to be treated as missing data.

...

(unused)

Author

Emmanuel Paradis

Details

The side effect of na.omit is to drop the rows (individuals) with unclearly identified genotypes, i.e., with at least one allele among na.alleles.

Other variables in the data table are eventually checked and levels with no observation (e.g., population) are dropped.

nullAlleles2NA does not remove any observation but changes these genotypes into NA.

Examples

Run this code
data(jaguar)
nrow(jaguar)
nrow(na.omit(jaguar))
nrow(nullAlleles2NA(jaguar))

Run the code above in your browser using DataLab