find.missing.gen: Find Missing Genotypes

Description Usage Arguments Value Author(s) See Also Examples

View source: R/individual_distance.R

Description

This function returns a data frame listing the locus and sample names of all genotypes with missing data.

Usage

1
2
find.missing.gen(object, samples = Samples(object),
                 loci = Loci(object))

Arguments

object

A genambig or genbinary object containing the genotypes of interest.

samples

A character vector of all samples to be searched. Must be a subset of Samples(object).

loci

A character vector of all loci to be searched. Must be a subset of Loci(object).

Value

A data frame with no row names. The first column is named “Locus” and the second column is named “Sample”. Each row represents one missing genotype, and gives the locus and sample of that genotype.

Author(s)

Lindsay V. Clark

See Also

isMissing

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# set up the genotype data
samples <- paste("ind", 1:4, sep="")
samples
loci <- paste("loc", 1:3, sep="")
loci
testgen <- new("genambig", samples = samples, loci = loci)
Genotypes(testgen, loci="loc1") <- list(c(-9), c(102,104),
                                        c(100,106,108,110,114),
                                        c(102,104,106,110,112))
Genotypes(testgen, loci="loc2") <- list(c(77,79,83), c(79,85), c(-9),
                                        c(83,85,87,91))
Genotypes(testgen, loci="loc3") <- list(c(122,128), c(124,126,128,132),
                                        c(120,126), c(124,128,130))

# look up which samples*loci have missing genotypes
find.missing.gen(testgen)

polysat documentation built on May 30, 2017, 6:57 a.m.

Search within the polysat package
Search all R packages, documentation and source code