permute_pam | R Documentation |
permute_pam: Function to permute a Presence-Absence-Matrix.
permute_pam(m, niter = NULL, as_sparse = FALSE)
m |
Presence-Absence-Matrix (PAM) or a binary matrix with columns representing species and rows sites. |
niter |
Number of itereations to permute the PAM. |
as_sparse |
If TRUE the PAM will be returned as a sparse matrix |
This function is an implementation of the curve ball algorithm following \insertRefStrona2014bam.
Returns a list of length equal to the number of sites in the PAM (n=nrows(m)). Each entrie of the list has the permuted species.
Luis Osorio-Olvera & Jorge SoberĂ³n
set.seed(111) pam <- matrix(rbinom(100,1,0.3),nrow = 10,ncol = 10) ppam <- bam::permute_pam(m = pam,niter = NULL,as_sparse = FALSE) # Check if matrices are different all(pam == ppam) # Check if row totals are the same all(Matrix::rowSums(pam) == Matrix::rowSums(ppam)) # Check if column total are the same all(Matrix::colSums(pam) == Matrix::colSums(ppam))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.