compare_covariates: Compare different combinations of covariates

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/compare_covariates.R

Description

Summarises the extent of univariate (Type I) and combinatorial (Type II) extrapolation associated with different combinations of input covariates.

Usage

1
2
3
4
5
6
7
8
9
compare_covariates(
  extrapolation.type = "both",
  extrapolation.object = NULL,
  n.covariates = NULL,
  create.plots = TRUE,
  display.percent = TRUE,
  verbose = TRUE,
  ...
)

Arguments

extrapolation.type

Character string. Type of extrapolation to be assessed. Can be one of univariate, combinatorial, or both (default).

extrapolation.object

List object as returned by compute_extrapolation.

n.covariates

Maximum number of covariates. The function will compare all combinations of 1 to n.covariates covariates.

create.plots

Logical, defaults to TRUE. Whether to produce summary plots.

display.percent

Logical. If TRUE (default), scales the y-axis of the summary plots as a percentage of the total number of grid cells in prediction.grid.

verbose

Logical. Show or hide possible warnings and messages.

...

Additional parameters passed to compute_extrapolation. These are optional when extrapolation.object is specified, and compulsory otherwise.

Details

The extent and magnitude of extrapolation naturally vary with the type and number of covariates considered. It may be useful, therefore, to test different combinations of covariates to inform their selection a priori, i.e. before model fitting, thereby supporting model parsimony.

Value

Prints a summary table in the R console. Also generates summary boxplots if create.plots is set to TRUE.

Author(s)

Phil J. Bouchet

References

Bouchet PJ, Miller DL, Roberts JJ, Mannocci L, Harris CM and Thomas L (2019). From here and now to there and then: Practical recommendations for extrapolating cetacean density surface models to novel conditions. CREEM Technical Report 2019-01, 59 p. https://research-repository.st-andrews.ac.uk/handle/10023/18509

Mesgaran MB, Cousens RD, Webber BL (2014). Here be dragons: a tool for quantifying novelty due to covariate range and correlation change when projecting species distribution models. Diversity & Distributions, 20: 1147-1159. DOI: 10.1111/ddi.12209

See Also

compute_extrapolation, summarise_extrapolation

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
library(dsmextra)

# Load the Mid-Atlantic sperm whale data (see ?spermwhales)
data(spermwhales)

# Extract the data
segs <- spermwhales$segs
predgrid <- spermwhales$predgrid

# Define relevant coordinate system
my_crs <- sp::CRS("+proj=aea +lat_1=38 +lat_2=30 +lat_0=34 +lon_0=-73 +x_0=0
 +y_0=0 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0")

# Define covariates
my_cov <- c("Depth", "SST", "NPP", "DistToCAS", "EKE")

# Compare the extent of univariate and combinatorial
# extrapolation for all combinations of 1 to 5 covariates
compare_covariates(extrapolation.type = "both",
                  covariate.names = my_cov,
                  n.covariates = NULL,
                  samples = segs,
                  prediction.grid = predgrid,
                  coordinate.system = my_crs,
                  create.plots = TRUE,
                  display.percent = TRUE)

# Can also run this function directly from the
# object returned by compute_extrapolation
spermw.extrapolation <- compute_extrapolation(samples = segs,
      covariate.names = my_cov,
      prediction.grid = predgrid,
      coordinate.system = my_crs)

compare_covariates(extrapolation.type = "both",
                   extrapolation.object = spermw.extrapolation)

densitymodelling/dsmextra documentation built on Feb. 12, 2022, 4:40 a.m.