# TWINSPAN in R applied on Danube dataset # Install the twinspanR library from GitHub repository: install.packages ('devtools') devtools::install_github("zdealveindy/twinspanR") # initiate the library and data library (twinspanR) data (danube) ?danube # calculates standard twispan, with default setting tw <- twinspan (danube$spe, modif = F) # cuts the results into vector of sample assignments to groups tw.groups <- cut (tw, cluster = 4) # Calculates and draws the DCA ordination diagram DCA <- decorana (log1p (danube$spe)) plot (DCA, display = 'sites', type = 'n') points (DCA, col = tw.groups) ordihull (DCA, groups = tw.groups) plot (envfit (DCA, danube$env[,1:3])) # Prints the two-way ordered table from twinspan print (tw, 'table')