isMissing returns Boolean values indicating whether the genotypes
for a given set of samples and loci are missing from the dataset.
An object of one of the subclasses of
A character or numeric vector indicating samples to be tested.
A character or numeric vector indicating loci to be tested.
isMissing is a generic function with methods for
For each genotype in a
genambig object, the function evaluates and returns
Genotype(object, sample, locus) == Missing(object). For a
TRUE %in% (Genotype(object, sample,
locus) == Missing(object)) is returned for the genotype. If only
one sample and locus are being evaluated, this is the Boolean value that
is returned. If multiple samples and/or loci are being evaluated, the
function creates an array of Boolean values and recursively calls itself
to fill in the result for each element of the array.
loci are of length 1, a single
Boolean value is returned,
TRUE if the genotype is missing, and
FALSE if it isn't. Otherwise, the function returns a named
array with samples in the first dimension and loci in the second
dimension, filled with Boolean values indicating whether the genotype
for each sample*locus combination is missing.
Lindsay V. Clark
1 2 3 4 5 6 7 8 9 10 11 12 13
# set up a genambig object for this example mygen <- new("genambig", samples=c("a", "b"), loci=c("locD", "locE")) Genotypes(mygen) <- array(list(c(122, 126), c(124, 128, 134), Missing(mygen), c(156, 159)), dim=c(2,2)) viewGenotypes(mygen) # test if some individual genotypes are missing isMissing(mygen, "a", "locD") isMissing(mygen, "a", "locE") # test an array of genotypes isMissing(mygen, Samples(mygen), Loci(mygen))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.