GLdeparture: Climatic departure of reference study area

Description Usage Arguments Details Value See Also Examples

Description

This function is used to facilitate comparisons between species in the same study area. It speeds up the computation of multiple departures by calculating the global covariance matrix as a first step, which can then be fed into the departure function as a first argument. This saves the user from having to calculate the global covariance matrix for each species, which can take quite a bit of time.

Usage

 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
37
38
39
40
41
42
43
GLdeparture(
  x,
  y,
  center = TRUE,
  scale = TRUE,
  filename = "",
  progress = FALSE,
  parallel = FALSE,
  n = 1,
  cl = NULL,
  keep.open = FALSE,
  ...
)

## S4 method for signature 'Raster,Raster'
GLdeparture(
  x,
  y,
  center = TRUE,
  scale = TRUE,
  filename = "",
  progress = FALSE,
  parallel = FALSE,
  n = 1,
  cl = NULL,
  keep.open = FALSE,
  ...
)

## S4 method for signature 'Raster,missing'
GLdeparture(
  x,
  y,
  center = TRUE,
  scale = TRUE,
  filename = "",
  progress = FALSE,
  parallel = FALSE,
  n = 1,
  cl = NULL,
  keep.open = FALSE,
  ...
)

Arguments

x

Raster* object of p historical climate layers

y

Raster* object of p future climate layers, with the same names as x

center

logical or numeric. If TRUE, centering is done by subtracting the layer means (omitting NAs), and if FALSE, no centering is done. If center is a numeric vector with length equal to the nlayers(x), then each layer of x has the corresponding value from center subtracted from it

scale

logical or numeric. If TRUE, scaling is done by dividing the (centered) layers of x by their standard deviations if center is TRUE, and the root mean square otherwise. If scale is FALSE, no scaling is done. If scale is a numeric vector with length equal to nlayers(x), each layer of x is divided by the corresponding value. Scaling is done after centering

filename

character. Optional filename to save the RasterBrick output to file. If this is not provided, a temporary file will be created for large x

progress

logical. If TRUE, messages and progress bar will be printed

parallel

logical. If TRUE then multiple cores are utilized

n

numeric. Number of CPU cores to utilize for parallel processing

cl

optional cluster object

keep.open

logical. If TRUE and parallel = TRUE, the cluster object will not be closed after the function has finished

...

Additional arguments for writeRaster

Details

If there is too much correlation between the layers of x, the covariance matrix will be singular, which will lead to later problems in computing the overall departures of species. In this case, a warning will be issued, suggesting the removal of correlated variables or a transformation of the data.

Value

Returns an S4 object of class GLcenfa with the following components:

global_difras

Raster* x of p layers, possibly centered and scaled

cov

Global p x p covariance matrix

See Also

departure

Examples

1

CENFA documentation built on Aug. 16, 2021, 9:06 a.m.