comparative.comm {pez} | R Documentation |
Creates a community comparative ecology object, the basis of all functions in pez
Description
Basic checking of whether the input data match up is performed; you
need only supply comm
and phy
, nothing else is
mandatory. You can manipulate the internals of
comparative.comm
, or use the wrappers inside pez
to
keep everything in order. Examples of these features are given
below; they are described in detailed at cc.manip
.
Usage
comparative.comm(
phy,
comm,
traits = NULL,
env = NULL,
warn = TRUE,
force.root = -1
)
## S3 method for class 'comparative.comm'
print(x, ...)
Arguments
phy |
phylogeny (in |
comm |
community |
traits |
|
env |
|
warn |
whether to warn if species/sites are dropped when creating object (default: TRUE) |
force.root |
if |
x |
|
... |
ignored |
Value
comparative.comm object
Note
comparative.comm
is compatible with
comparative.data
; this means
that the slot for species' trait data is called data
. I
appreciate this is somewhat unwieldy, but hopefully you agree it is
helpful in the long-term.
Author(s)
Will Pearse
See Also
plot.comparative.comm
cc.manip
link[caper:comparative.data]{comparative.data}
Examples
data(laja)
data <- comparative.comm(invert.tree, river.sites, invert.traits, river.env)
#Subset on species, then sites
data <- data[1:5,]
data <- data[,1:5]
#Site and species can be manipulated
species(data)
sites(data)[1:3] <- c("lovely", "invert", "sites")
#Other data can be viewed
trait.names(data)
env.names(data)
#Get assemblage phylogenies of all sites
assemblage.phylogenies(data)
#Do some manual manipulation of your objects (NOTE: $data for traits)
data$data$new.trait <- sample(letters, nrow(data$comm), replace=TRUE)