Description Usage Arguments Author(s) Examples
subset
is a generic function with methods for
obkData, obkSequences and
obkContacts objects. It can be used to subset data by
specified individuals, samples, loci, sequences, or date range. Note
that several subsetting criteria can be specified at the same time.
1 2 3 4 5 6 7 8 9 10 11 | ## S4 method for signature 'obkData'
subset(x, individuals=NULL, locus=NULL, sequences=NULL,
date.from=NULL, date.to=NULL, date.format=NULL, ...)
## S4 method for signature 'obkSequences'
subset(x, sequences=NULL, locus=NULL, individuals=NULL,
date.from=NULL, date.to=NULL, date.format=NULL, ...)
## S4 method for signature 'obkContacts'
subset(x, individuals=NULL, date.from=NULL,
date.to=NULL, date.format=NULL, ...)
|
x |
an obkData object. |
individuals |
labels of retained individuals; if integer, numeric
or logical are provided, they are assumed to indicate individuals as
returned by |
locus |
labels of retained loci; if integer, numeric
or logical are provided, they are assumed to indicate locus as
returned by |
sequences |
labels of retained loci; if integer, numeric
or logical are provided, they are assumed to indicate sequences as
returned by |
date.from, date.to |
the range of dates (in Date format) of retained samples. |
date.format |
the format for dates if in character strings;
defaults to "%Y-%m-%d" (see |
... |
currently not used. |
Thibaut Jombart
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ## LOAD ToyOutbreak obkData object ##
data(ToyOutbreak)
x <- ToyOutbreak
## TEST VARIOUS SUBSETTING ##
## by individual
get.individuals(x)
plot(x)
plot(subset(x, individuals=1:10))
subset(x, individuals=1)
subset(x, individuals="15")
## by locus
get.locus(x)
subset(x, locus=2)
## by locus and sequences
subset(x, locus=1, sequence=1:10)
plot(subset(x, locus=1, sequence=1:10))
plot(subset(x, locus=1, sequence=1:10), "phy")
## by dates
get.dates(x)
plotIndividualTimeline(subset(x, date.to="2000-01-05"), "dna")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.