File: persp.renyiaccum.R

package info (click to toggle)
r-cran-vegan 2.5-7%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 5,564 kB
  • sloc: ansic: 2,275; fortran: 1,088; sh: 42; makefile: 2
file content (18 lines) | stat: -rw-r--r-- 623 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
`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,  ...)
}