### Synoptic table of Scheden vegetation data using syntable()-function:
# classification to create a vector of cluster identity
library(cluster)
pam1 <- pam(schedenveg, 4)
### One input table for sorting:
## Synoptic table with percentage frequency of species in clusters, all species
unordered <- syntable(schedenveg, pam1$clustering, abund = "percentage",
type = "percfreq") # Unordered synoptic percentage frequency table
sorted <- synsort(syn1 = unordered$syntable, matrix = schedenveg,
cluster = pam1$clustering, method = "allspec", min1 = 0)
sorted # view results
if (FALSE) {
# Export sorted synoptic table
write.csv(sorted$syntab, "syntab.csv")
# Export sorted species-sample matrix with original releve data for postprocessing
write.csv(sorted$samples, "output_species_sample.csv")}
## Synoptic table with only phi values
phi <- syntable(schedenveg, pam1$clustering, abund = "percentage",
type = "phi") # calculates cluster-wise phi for each species
phi_table <- synsort(syn1 = phi$syntable, matrix = schedenveg, cluster = pam1$clustering,
method = "allspec", min1 = 0.3)
phi_table # view results
### Two numerical tables for sorting:
## Synoptic table showing percentage frequencies, but only for species with minimum phi-value
## of 0.3 AND exclude species with less than 25% percentage frequency
unordered <- syntable(schedenveg, pam1$clustering, abund = "percentage",
type = "percfreq") # Unordered synoptic percentage frequency table
phitable <- syntable(schedenveg, pam1$clustering, abund = "percentage",
type = "phi") # calculates cluster-wise phi for each species
# now sorting and arranging
phi_complete <- synsort(syn1 = unordered$syntable, syn2 = phitable$syntable,
matrix = schedenveg, cluster = pam1$clustering, method = "allspec",
min1 = 25, min2 = 0.3)
phi_complete # view results
### Differential species analysis
differential <- syntable(schedenveg, pam1$clustering, abund = "percentage",
type = "diffspec")
## Synoptic table with percentage frequency (only species >25%) and
## differential character.
complete <- synsort(syn1 = unordered$syntable, syn2 = differential$syntable,
matrix = schedenveg, cluster = pam1$clustering,
method = "alldiff", min1 = 25)
complete # view result table
differential$differentials # list differential species for clusters
Run the code above in your browser using DataLab