R/community.R

Defines functions siteBySpecies

Documented in siteBySpecies

# Generate site-by-species matrix
siteBySpecies <- function(phy, presence.only=FALSE,
    na.zero=FALSE, transpose=FALSE) {

    if (presence.only) {
        dat <- presence(phy, na.zero=na.zero)
    } else {
        dat <- abundance(phy, na.zero=na.zero)
    }
    mat <- as.matrix(dat)
    if (!transpose) mat <- t(mat)
    return(mat)

}

Try the ecoPD package in your browser

Any scripts or data that you put into this service are public.

ecoPD documentation built on May 2, 2019, 5:22 p.m.