Learn R Programming

poppr (version 1.1.5)

missingno: How to deal with missing data in a genind object.

Description

missingno gives the user four options to deal with missing data.

Usage

missingno(pop, type = "loci", cutoff = 0.05, quiet = FALSE)

Arguments

pop
a genclone or genind object.
type
a character string: can be "ignore", "zero", "mean", "loci", or "geno" (see Details for definitions).
cutoff
numeric. A number from 0 to 1 indicating the allowable rate of missing data in either genotypes or loci. This will be ignored for type values of "mean" or "zero".
quiet
if TRUE, it will print to the screen the action performed.

Value

  • a genclone or genind object.

Details

These methods provide a way to deal with systematic missing data and to give a wrapper for adegenet's na.replace function. ALL OF THESE ARE TO BE USED WITH CAUTION.

Treatment types{

  • "ignore"- does not remove or replace missing data.
"loci" - removes all loci containing missing data in the entire data set. "genotype" - removes any genotypes/isolates/individuals with missing data. "mean" - replaces all NA's with the mean of the alleles for the entire data set. "zero" or "0" - replaces all NA's with "0". Introduces more diversity.}

See Also

na.replace, poppr, poppr.amova, nei.dist, aboot

Examples

Run this code
data(nancycats)

nancy.locina <- missingno(nancycats, type = "loci")

## Found 617 missing values.
## 2 loci contained missing values greater than 5\%.
## Removing 2 loci : fca8 fca45

nancy.genona <- missingno(nancycats, type = "geno")

## Found 617 missing values.
## 38 genotypes contained missing values greater than 5\%.
## Removing 38 genotypes : N215 N216 N188 N189 N190 N191 N192 N302 N304 N310
## N195 N197 N198 N199 N200 N201 N206 N182 N184 N186 N298 N299 N300 N301 N303
## N282 N283 N288 N291 N292 N293 N294 N295 N296 N297 N281 N289 N290

# Replacing all NA with "0" (see na.replace in the adegenet package).
nancy.0 <- missingno(nancycats, type = "0")

## Replaced 617 missing values

# Replacing all NA with the mean of each column (see na.replace in the
# adegenet package).
nancy.mean <- missingno(nancycats, type = "mean")

## Replaced 617 missing values

Run the code above in your browser using DataLab