R/rdacca_taxon_stats.R
rdacca_taxon_stats.Rdrdacca_taxon_stats(object, rank = 1)A matrix with taxa in rows and taxon specific statistics in columns:
sample variance of the taxon.
R squared: fraction of the sample variance explained by the predictors and covariates.
fraction of the sample variance explained by the predictors after adjustment for the covariates.
fraction of the sample variance explained by the first k axes (the axes are constrained in a constrained ordination and unconstrained otherwise).
F-ratio of the regression model with k axes (as predictors) and the model without axes (i.e. with covariates or the intercept only).
The code uses ordiYbar and scores and also works for unconstrained ordination
using rdaand cca. The software Canoco 5 (ter Braak & Smilauer, 2018) contains Cfit and a rescaled
version of the column Var but not the columns Fratio.k.
ter Braak C.J.F. & Šmilauer P. (2018): Canoco reference manual and user's guide: software for ordination, version 5.1x. Microcomputer Power, Ithaca, USA, 536 pp. (http::www.canoco5.com)
data(pyrifos, package = "vegan") #transformed species data from package vegan
#the chlorpyrifos experiment from van den Brink & ter Braak 1999
Design <- data.frame(
week=gl(11, 12, labels=c(-4, -1, 0.1, 1, 2, 4, 8, 12, 15, 19, 24)),
dose=factor(rep(c(0.1, 0, 0, 0.9, 0, 44, 6, 0.1, 44, 0.9, 0, 6), 11)))
library(vegan)
mod_rda <- rda( pyrifos ~ dose:week + Condition(week), data = Design)
#>
#> Some constraints or conditions were aliased because they were redundant. This
#> can happen if terms are constant or linearly dependent (collinear):
#> 'dose44:week-4', 'dose44:week-1', 'dose44:week0.1', 'dose44:week1',
#> 'dose44:week2', 'dose44:week4', 'dose44:week8', 'dose44:week12',
#> 'dose44:week15', 'dose44:week19', 'dose44:week24'
species_scores= scores(mod_rda,choices =1:2, display="sp",scaling = 1)
library(PRC)
head(rdacca_taxon_stats(mod_rda)) # stats per species
#> Var FitCE FitE Cfit1 Fratio1
#> Simve 2.6532363 0.7445540 0.5301872 0.37998997 112.411089
#> Daplo 1.9284326 0.6716078 0.3173191 0.15519258 37.966156
#> Cerpu 1.3570910 0.7312918 0.3269379 0.03028521 6.428153
#> Alogu 0.6614163 0.6542465 0.2391233 0.01654335 3.493023
#> Aloco 0.1899789 0.5043404 0.3404953 0.02301403 3.396316
#> Alore 0.7694871 0.7428779 0.3126996 0.01799620 3.913455
get_focal_and_conditioning_factors(mod_rda) # factors from the model
#> $`focal factor`
#> [1] "dose"
#>
#> $condition
#> [1] "week"
#>
#> attr(,"interaction")
#> [1] TRUE
species_scores= vegan::scores(mod_rda,choices =1:2, display="sp",scaling = 2)
# 1-d vertical plot of species scores (a cut of RDA1-scores at 0.5)
plot_species_scores_bk(species_scores)
#> 15 species with names out of 178 species
# a cut of RDA1-scores at 1.0 (as scoresname is unset)
plot_species_scores_bk(species_scores, threshold = 14)
#> 3 species with names out of 178 species
plot_species_scores_2d(species_scores)
#> 12 species with names out of 178 species
plot_species_scores_2d(species_scores, label.repel = TRUE)
#> 12 species with names out of 178 species
plot_species_scores_2d(species_scores, max.overlaps = 30, label.repel = TRUE)
#> 12 species with names out of 178 species