Description Usage Arguments Details Value Author(s) See Also Examples
Returns a site-by-species matrix of abundance or presence/absence values from a phylo4com object.
1 | siteBySpecies(phy, presence.only=FALSE, na.zero=FALSE, transpose=FALSE)
|
phy |
a |
presence.only |
logical. Should abundance values be replaced with 1/0 indicators of presence/absence? |
na.zero |
logical. should NAs be treated as zero abundances? |
transpose |
logical. Should matrix be transposed to put species in rows and sites in columns? |
If na.zero
is false (the default), any NA
values in the
abundance data will be preserved in the matrix. However, abundance is
assumed to be 0 for all species absent from the subtree for a given
site.
If presence.only
is true, the matrix will contain 1 for species
with positive abundances in the corresponding tree, and 0 both for
species with non-positive abundances and for species absent from the
tree for a given site. As with abundance, if na.zero
is false,
NA
values in the abundance data will remain as NA
in the
matrix.
In the default orientation, species will be in columns and sites in
rows. To swap rows and columns, use transpose=TRUE
(or manually
transpose the returned object).
Numeric matrix
Jim Regetz (regetz@nceas.ucsb.edu)
This function is just a convenience wrapper for the
abundance
and presence
functions.
1 2 3 4 5 6 7 | data(weeds)
siteBySpecies(weeds)
siteBySpecies(weeds, presence.only=TRUE)
## change an abundance value to NA
abundance(weeds, "A", 1) <- NA
siteBySpecies(weeds, presence.only=TRUE, transpose=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.