summarize.mat <- function(.mat){
.bmat <- .mat>0 # create a binary occurrence matrix
list(
Ntot=sum(.mat), # total abundance
Occ=which(.bmat), # indices of occurrence
Otot=sum(.bmat), # total occurrences
Nspp=rowSums(.mat), # species abundances
Ospp=rowSums(.bmat), # species occurrences
Nsit=colSums(.mat), # site abundances
Osit=colSums(.bmat) # site occurrences
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.