Worked example 4

WE4 illustrates the use of package diversity to perform variogram-based multi-scale ordinations (msov) as in Couteron & Ollier (2005). The specific functions are depend on spdep package, which must be intalled before loading diversity. The worked example uses Counami Forest Inventory data set (CFI) from Couteron et al. (2003).


1 - Data input

Once the library diversity has been installed and loaded:

data(CFI)
str(CFI)

#List of 4
# $ topo: Factor w/ 12 levels "10","20","21",..: 3 3 4 7 7 12 3 10 1 12 ...
# $ xy  : num [1:411, 1:2] 0 0 0 0 0 0 0 0 0.5 0.5 ...
#  ..- attr(*, "dimnames")=List of 2
#  .. ..$ : chr [1:411] "1" "2" "3" "4" ...
#  .. ..$ : chr [1:2] "X" "Y"
# $ tab : int [1:411, 1:59] 1 2 5 2 1 0 0 3 0 0 ...
#  ..- attr(*, "dimnames")=List of 2
#  .. ..$ : chr [1:411] "1" "2" "3" "4" ...
#  .. ..$ : chr [1:59] "Sp1" "Sp2" "Sp3" "Sp4" ...
# $ dbh : int [1:411, 1:14] 6 11 5 8 9 10 8 13 7 8 ...
#  ..- attr(*, "dimnames")=List of 2
#  .. ..$ : chr [1:411] "1" "2" "3" "4" ...
#  .. ..$ : chr [1:14] "C1" "C2" "C3" "C4" ...


CFI$tab is an
abundance matrix of 59 tree species in 411 plots
CFI$topo is a vector of 12 eco-topographical codes assigned to plots
CFI$xy is a matrix of geographical co-ordinates of plots
CFI$dbh is a matrix of the frequency distribution of trees within plots into 14 diameter classes


2 - Spatial patterns displayed by CA axes

Perform CA of the species abundance table:

cfi.ca<-ca.richness(CFI$tab,test=FALSE)
#Select the number of axes:
3
summary(cfi.ca)
#class:  summary.dudiv
#metric: Richness
#call: ca.richness.default(Y = CFI$tab, test = FALSE)
#
#total diversity: 58
#explained diversity: 5.57
#ratio of explained diversity: 0.096

Compute the k lists of neighbours defining the scales (distance classes) of the spatial analysis:

cfi.knb<-bornes2knb(CFI$xy,c(0.38,0.45,0.80,1.20,2.00,3.00,4.00,5.00,7.00,9.00,13.00))
summary(cfi.knb)

Compute the variograms and cross-variogram of CA axes 2 and 3, with tests of statistical significance based on 300 reallocations of the floristic compositions to the the sample sites (this could take a few minutes to run):

cfi.ca.rtest<-kmsov.rtest(cfi.ca,cfi.knb,ax=c(2,3),nrepet=300)


a) variogram of CA axis 2 (Fig. 1a black in the original paper)
b) cross-variogram of CA axes 2 and 3 (Fig. 1e)
c) variogram of CA axis 3 (Fig. 1b black)

3 - Spatial patterns displayed by residual CA axes

Perform residual-CA of the species abundance table, once the effect of the 'topo' variable has been removed:

cfi.ca.res<-ca.richness(CFI$tab~Condition(CFI$topo),test=FALSE)
#Select the number of axes:
3
summary(cfi.ca.res)
#class:  summary.dudiv
#metric: Richness
#call: ca.richness.formula(formula = CFI$tab ~ Condition(CFI$topo), test = FALSE)
#
#total diversity: 58
#explained diversity: 5.21
#ratio of explained diversity: 0.0898

Compute the variograms and cross-variogram of residual-CA axes 2 and 3, with tests of statistical significance based on 300 reallocations of the floristic compositions to the the sample sites (this could take a few minutes to run):

cfi.ca.res.rtest<-kmsov.rtest(cfi.ca.res,cfi.knb,ax=c(2,3),fac=CFI$topo,nrepet=300)


a) variogram of residual-CA axis 2 (Fig. 1a white in the original paper)
b) cross-variogram of residual-CA axes 2 and 3 (not show in the original paper)
c) variogram of residual-CA axis 3 (Fig. 1b white)


4 - Spatial patterns displayed by NSCA axes

Perform NSCA of the species abundance table:

cfi.nsca<-nsca.simpson(CFI$tab,test=FALSE)
#Select the number of axes:
3
summary(cfi.nsca)
#class:  summary.dudiv
#metric: Simpson
#call: nsca.simpson.default(Y = CFI$tab, test = FALSE)
#
#total diversity: 0.89
#explained diversity: 0.117
#ratio of explained diversity: 0.131
 

Compute the variograms and cross-variogram of NSCA axes 1 and 2, with tests of statistical significance based on 300 reallocations of the floristic compositions to the the sample sites (this could take a few minutes to run):

cfi.nsca.rtest<-kmsov.rtest(cfi.nsca,cfi.knb,ax=c(1,2),nrepet=300)


a) variogram of NSCA axis 1 (Fig. 1c black in the original paper)
b) cross-variogram of NSCA axes 1 and 2 (Fig. 1f)
c) variogram of NSCA axis 2 (Fig. 1b black)


5 - Spatial patterns displayed by residual NSCA axes

Perform residual NSCA of the species abundance table, once the effect of the 'topo' variable has been removed:

cfi.nsca.res<-nsca.simpson(CFI$tab~Condition(CFI$topo),test=FALSE)
#Select the number of axes:
3
summary(cfi.nsca.res)
#class:  summary.dudiv
#metric: Simpson
#call: nsca.simpson.formula(formula = CFI$tab ~ Condition(CFI$topo), test = FALSE)
#
#total diversity: 0.89
#explained diversity: 0.104
#ratio of explained diversity: 0.117

Compute the variograms and cross-variogram of residual-NSCA axes 1 and 2, with tests of statistical significance based on 300 reallocations of the floristic compositions to the the sample sites (this could take a few minutes to run):

cfi.nsca.res.rtest<-kmsov.rtest(cfi.nsca.res,cfi.knb,ax=c(1,2),fac=CFI$topo,nrepet=300)


a) variogram of residual-NSCA axis 1 (Fig. 1c white in the original paper)
b) cross-variogram of residual-NSCA axes 1 and 2 (Not shown in the original paper)
c) variogram of residual-NSCA axis 2 (Fig. 1b white)

Literature cited

Couteron, P., Pélissier, R. Mapaga, D., Molino, J.-F. and Teillier, L. 2003. Drawing ecological insights from a management-oriented forest inventory in French Guiana. Forest Ecology and Management, 172:89-108.

Couteron, P. and Ollier, S. 2005. A generalized, variogram-based framework for multiscale ordination. Ecology, 86:828-834.