CompadreDB | R Documentation |
This page describes the CompadreDB class, including methods for accessing the
slots (see functions CompadreData
and VersionData
), accessing
($
) and replacing ($<-
) columns within the data
slot,
accessing elements from the version
slot (see functions
VersionData
and DateCreated
), and converting legacy database
objects to the CompadreDB class (see as_cdb
).
CompadreData(object)
## S4 method for signature 'CompadreDB'
CompadreData(object)
## S4 method for signature 'CompadreDB'
x$name
## S4 replacement method for signature 'CompadreDB'
x$name <- value
## S4 method for signature 'CompadreDB,ANY,missing'
x[[i, j, ...]]
## S4 replacement method for signature 'CompadreDB,ANY,missing'
x[[i, j]] <- value
VersionData(object)
## S4 method for signature 'CompadreDB'
VersionData(object)
Version(object)
## S4 method for signature 'CompadreDB'
Version(object)
DateCreated(object)
## S4 method for signature 'CompadreDB'
DateCreated(object)
object |
A CompadreDB object |
x |
A CompadreDB object |
name |
The name of a column within x |
value |
Vector of values to assign to the column |
i , j |
elements to extract or replace (see [[.data.frame) |
... |
ignored |
data
A tibble-style data frame with a list-column of matrix population
models (column mat
) and a variety of other metadata columns.
version
A list with elements Version
(database version number),
DateCreated
(date of version release), and Agreement
(a url
link to the User Agreement)
Iain M. Stott
Tamora D. James
CompadreDB-Methods
CompadreDB-Subsetting
# extract entire 'data' slot
dat <- CompadreData(Compadre)
# access the date of database creation
DateCreated(Compadre)
# extract column SpeciesAccepted
Compadre$SpeciesAccepted
# create new list-column with stage-specific survival
Compadre$stage_survival <- lapply(Compadre$mat, function(x) colSums(x@matU))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.