R/persp.renyiaccum.R

Defines functions `persp.renyiaccum`

`persp.renyiaccum` <-
    function(x, theta = 220, col = heat.colors(100), zlim, ...)
{
    dn <- dimnames(x)
    Sites <- seq(along=dn[[1]])
    Scale <- seq(along=dn[[2]])
    Diversity <- x[,,"mean"]
    if (missing(zlim))
        zlim <- range(Diversity, 0)
    if (length(col) > 1) {
        ind <- Diversity
        ind <- (ind[-1,-1] + ind[-1,-ncol(ind)] + ind[-nrow(ind),-1] +
                ind[-nrow(ind),-ncol(ind)])/4
        ind <- round((length(col) - 1) * (ind - min(ind))/diff(range(ind)) + 1)
        col <- col[ind]
    }
    persp(Sites, Scale, Diversity, theta = theta, zlim = zlim, col = col,  ...)
}

Try the vegan package in your browser

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

vegan documentation built on Sept. 11, 2024, 7:57 p.m.