File: print.summary.permat.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 (41 lines) | stat: -rw-r--r-- 2,173 bytes parent folder | download | duplicates (4)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
## S3 print method for summary.permat
`print.summary.permat` <-
function(x, digits=2, ...)
{
    n <- attr(x$x, "times")
    cat("Summary of object of class 'permat'\n\nCall: ")
    print(x$x$call)
    cat("\nMatrix type:", attr(x$x, "mtype"), "\nPermutation type:", attr(x$x, "ptype"))
    cat("\nMethod: ", attr(x$x, "method"), sep = "")
    if (attr(x$x, "ptype") == "swap") {
        if (!is.na(attr(x$x, "burnin")))
            cat(", burnin: ", attr(x$x, "burnin"), sep = "")
        if (!is.na(attr(x$x, "thin")))
            cat(", thin: ", attr(x$x, "thin"), sep = "")
    }
    cat("\nRestricted:", attr(x$x, "is.strat"), "\nFixed margins:", attr(x$x, "fixedmar"))
    if (!is.na(attr(x$x, "shuffle"))) {
        if (attr(x$x, "shuffle")=="ind") cat("\nIndividuals")
        if (attr(x$x, "shuffle")=="samp") cat("\nSamples")
        if (attr(x$x, "shuffle")=="both") cat("\nIndividuals and samples")
    cat(" are shuffled")
    }
    cat("\n\nMatrix dimensions:", nrow(x$x$orig), "rows,", ncol(x$x$orig), "columns")
    cat("\nSum of original matrix:", sum(x$x$orig))
    cat("\nFill of original matrix:", round(sum(x$x$orig>0)/(nrow(x$x$orig)*ncol(x$x$orig)),digits))
    cat("\nNumber of permuted matrices:", n,"\n")
    cat("\nMatrix sums retained:", round(100 * sum(x$sum) / n, digits), "%")
    cat("\nMatrix fill retained:", round(100 * sum(x$fill) / n, digits), "%")
    cat("\nRow sums retained:   ", round(100 * sum(x$rowsums) / n, digits), "%")
    cat("\nColumn sums retained:", round(100 * sum(x$colsums) / n, digits), "%")
    cat("\nRow incidences retained:   ", round(100 * sum(x$browsums) / n, digits), "%")
    cat("\nColumn incidences retained:", round(100 * sum(x$bcolsums) / n, digits), "%")
    if (!is.null(x$strsum))
        cat("\nSums within strata retained:", round(100 * sum(x$strsum) / n, digits), "%")
    cat("\n\nBray-Curtis dissimilarities among original and permuted matrices:\n")
    print(summary(x$bray))
    cat("\nChi-squared for original matrix: ", round(attr(x$chisq, "chisq.orig"), digits), "\n", sep = "")
    cat("Chi-squared values among expected and permuted matrices:\n")
    print(summary(x$chisq))
invisible(x)
}