gamfit: GAM for environment-ordination fit

Description Usage Arguments Details Value See Also Examples

Description

Generalized Additive Model (GAM) to regress one or many environmental variables on NMDS ordination scores.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
gamfit(ord, env, ...)

## S3 method for class 'gamfit'
print(x, ...)

## S3 method for class 'gamfit'
summary(object, ...)

## S3 method for class 'gamfit'
fitted(object, ...)

## S3 method for class 'gamfit'
plot(x, pick = 1, pcol, lcol, pcex, lwd, labcex,
  title = TRUE, nlevels = 10, levels, xlab, ylab, ...)

gamfit_sens(x, env, nrep = 99, perc = 5, ...)

## S3 method for class 'gamfit_sens'
plot(r, stat = "r2", pltype = "joy", ...)

## S3 method for class 'gamfit_sens'
summary(r, x, ...)

Arguments

ord

ordination model from vegan

env

environmental matrix with variables to evaluate

...

additional arguments passed to gam

x, object

object of class gamfit

pick

numeric, the column number of environmental variable to plot as a nonlinear regression surface in the ordination space

pcol, lcol

point and line colors

pcex, lwd

point size and line width

title

logical, add variable name as title? (default=TRUE)

nrep

number of repetitions for sensitivity analysis (default=99)

perc

numeric, percent noise to add to env variables for sensitivity analysis

r

object of class gamfit_sens, from sensitivity analysis

stat

one of c('r2','pval') to plot from sensitivity analysis

pltype

one of c('heat','joy') for a heatmap or joyplot, respectively

Details

Nonlinear regression of each environmental variable in turn on the site scores resulting from NMDS ordination. Returns p-values for the joint smooth term, and adjusted-R2 expressing the strength of (nonlinear) relationship between each environmental variable and the ordination. Print, summary and plot methods exist. Sensitivity analysis currently exists but needs refinement.

Value

Object of class gamfit or gamfit_sens for those functions respectively, or plots to device.

See Also

gam for the internal fitting function, ordisurf for a similar procedure that only admits variables one-at-a-time, and envfit for a linear alternative. Plotting methods for sensitivity analysis follow plot_joy and plot_heatmap.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
data(veg)
spe <- veg$spe
env <- veg$env
m <- vegan::metaMDS(vegan::vegdist(spe), trace=0)
g <- gamfit(m, env)
g
plot(g, pick=10)

# sensitivity analysis
r <- gamfit_sens(g, env)
plot(r, pltype='heat')
plot(r, pltype='joy')
(MAE <- summary(r, g))
plot(MAE, xaxt='n', las=1)
axis(1, 1:NCOL(env), names(env), cex.axis=0.7)
sapply(data.frame(r[,,1]<0.05),sum) / 99 # proportion 'significant'

phytomosaic/foggy documentation built on Nov. 5, 2019, 12:20 a.m.