These functions remove samples or loci from all relevant slots of an object.
An object containing the dataset of interest. Generally an object of
some subclass of
A numerical or character vector of samples to be removed.
A numerical or character vector of loci to be removed.
These are generic functions with methods for
gendata objects. The methods for the subclasses remove samples
@Genotypes slot, then pass the object to the method for
gendata, which removes samples or loci from the
@Usatnts slots, as appropriate. The
@PopNames slot is left untouched even if an entire population is
deleted, in order to preserve the connection between the numbers in
@PopInfo and the names in
If your intent is to experiment with excluding samples or loci, it may
be a better idea to create character vectors of samples and loci that
you want to use and then use these vectors as the
loci arguments for analysis or export functions.
An object identical to
object, but with the specified samples or
These functions are somewhat redundant with the subscripting function
"[", which also works for all
gendata objects. However,
they may be more convenient depending on whether the user prefers to
specify the samples and loci to use or to
Lindsay V. Clark
1 2 3 4 5 6 7 8 9 10 11 12 13
# set up genambig object mygen <- new("genambig", samples = c("ind1", "ind2", "ind3", "ind4"), loci = c("locA", "locB", "locC", "locD")) # delete a sample Samples(mygen) mygen <- deleteSamples(mygen, "ind1") Samples(mygen) # delete some loci Loci(mygen) mygen <- deleteLoci(mygen, c("locB", "locC")) Loci(mygen)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.