Description Usage Arguments Author(s) Examples
get.data
is a generic function with a method for
obkData objects. It can be used to retrieve various
information, known only by the name of the field looked for.
1 2 3 4 5 |
x |
an obkData object. |
data |
a character string indicating the name of the data field to look for. |
where |
an optional character string indicating the name of the
slot in which the information should be looked for; if NULL, the
method will look in all slots starting with |
drop |
a logical indicating if a vector should be returned
(TRUE), as opposed to a |
showSource |
a logical indicating if information about individualIDs and slot sources should be returned. If TRUE a dataframe with three columns will be returned, as opposed to a vector/single column if FALSE. |
... |
currently not used. |
Thibaut Jombart, Lulla Opatowski
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## LOAD DATA ##
data(ToyOutbreak)
ls()
## VARIOUS USE OF GET.DATA ##
# list all the data with name 'Sex' from the obkData object
get.data(ToyOutbreak, "Sex")
# list all the data with 'date' from the obkData object
get.data(ToyOutbreak, "date")
get.data(ToyOutbreak, "date", showSource=TRUE)
get.data(ToyOutbreak, "date", where="records")
# Extract from the obkData object a given field
x <- get.data(ToyOutbreak, "records")
names(x) # x contains the whole 'records' list
head(x$Fever)
x <- get.data(ToyOutbreak, "samples")
names(x) # x contains the whole 'samples' data.frame
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.