R/swan.R

swan <-
function (x, maxit = Inf)
{
    zeros <- -Inf
    iter <- 0
    while(zeros != (zeros <- sum(x == 0)) && any(x == 0) &&
          iter < maxit) {
        x[x > 0] <- x[x > 0] - min(x[x > 0]) + 1
        x[x == 0] <- beals(x)[x == 0]
        iter <- iter + 1
    }
    x
}
### (Ecology 51, 89-102; 1970).

Try the vegan package in your browser

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

vegan documentation built on May 2, 2019, 5:51 p.m.