Data source: Romero Gonzalez-Quijano 2022. Biogeosciences 19: 2841-2853, https://doi.org/10.5194/bg-19-2841-2022 A range of urban water bodies in Berlin´s extensive ‘aquascape’ were investigated for properties of dissolved organic matter (DOM). There were 4 seasonal campaigns, water bodies were classified into 2 lotic (rivers and streams) and 2 lentic (lakes and ponds) types. DOM can be considered to drive and indicate various ecosystem functions like respiration, primary production. It may also indicate pollution and react to input from the terrestrial surrounding.
We will need the ‘vegan’ package (a lot of ordinations coded by ecologists for ecologists). Some more classical ordinations like PCA are available in the package ‘MASS’.
library(vegan)
library(MASS)
DOM<-read.table(file="data/DOM_Berlin_Romero.txt",header=TRUE)
names(DOM)
The dataset includes DOC indicating pure quantity and several descriptors of DOM quality measured by optical instruments (SR:fresh,C1:C6), chromatography (HMWS.C:humic.N) and mass spectrometry (avgmolmass:O_C). See the Excel sheet or the original paper for detailed variable description. Mass-spectrometric information only exist for three seasons. The dataset also includes variables that should be considered as drivers of DOM composition: nutrient concentrations, Chlorophyll-a, landuse percentages (NH4:URG).
DOM2<-DOM[,8:27]
boxplot(scale(DOM2))
# also make histograms
# maybe consider transformation of variables to improve linearity of relationships
plot(scale(DOM2))
rda()
summary()
screeplot()
levels(DOM$Type)
DOM$col.type<-DOM$Type
levels(DOM$col.type)<-c("darkgreen","lightgreen","darkblue","lightblue")
DOM$col.type<-as.character(DOM$col.type)
ordispider()
ordiellipse()
ordihull()
Adding incomplete descriptors: Mass-spectrometric information is incomplete (we lack data from one season). It could still be informative to show how these data behave in the ordination space. Compute correlations with PCs and plot these as (maybe differently colored) arrows into ordination space.
Assess potential drivers: The dataset includes a few variables that could be considered drivers of DOM composition (or drivers of processes that influence DOM). Assess these drivers by plotting them into ordination space and running correlations/regressions with PC1 and PC2.
envfit() # take care: behaviour of variables not necessarily monotonous in ordination space
ordisurf() # as contourplot
zDOM2<-scale(DOM2) # must at least be centered even if dimensionally homogeneous!
xmat<- # the constraints (or drivers or predictors)
rda<-rda(zDOM2~...+...+...,data=xmat) # take care: confusing X and Y argument names if you work without formula notation
summary()
RsquareAdj()
anova() # note argument "by"
scores()
plot()
Arrows()