File: radfit.data.frame.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 (26 lines) | stat: -rw-r--r-- 573 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
`radfit.data.frame` <-
    function(x, ...)
{
    ## x *must* have rownames
    rownames(x) <- rownames(x, do.NULL = TRUE)
    ## remove empty rows with no species
    nspec <- specnumber(x)
    if (any(nspec == 0)) {
        warning("removed empty rows with no species")
        x <- x[nspec>0,, drop=FALSE]
    }
    out <- apply(x, 1, radfit, ...)
    if (length(out) == 1)
        out <- out[[1]]
    else {
        Call <- match.call()
        class(out) <- "radfit.frame"
    }
    out
}

`radfit.matrix` <-
    function(x, ...)
{
    radfit(as.data.frame(x), ...)
}