gam_sdm: SDM fit with gam

Description Usage Arguments Value Examples

View source: R/gam_sdm.R

Description

Build a gam species distribution model from the output from an operating model. Models fit to both the presence (pres column) and log(abundance) are returned. k can be passed in to change the smoothing.

Usage

1
gam_sdm(x, covariates = NULL, start.forecast.year = 2021, k = NULL)

Arguments

x

(required) An operating model as output from one of the operating model functions (such as sim <- SimulateWorld() OR list with meta$abund_enviro and grid from the operating model (sim$grid).

covariates

Covariates to use in the SDM. Must be in the operating model output (in the columns of x$grid). If left off, all covariates in x (in x$meta$covariates) are used.

start.forecast.year

The years less will be used for fitting and the years greater than are the forecasted years.

k

The smoothness of the fit can be restricted by passing in k. If left off, the default will be used.

Value

A SDM object, which is a list with the presence and abundance fits and the meta data.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# use defaults
sim <- SimulateWorld(n.year=10)
fit <- gam_sdm(sim, "temp")
# plot center of gravity
## Not run:  #plot center of gravity (slow)
plot_cog(sim, fit)

## End(Not run)

# presence fit
summary(fit$presence)
# abundance fit
summary(fit$abundance)

stephbrodie1/WRAP documentation built on Feb. 13, 2021, 12:55 a.m.