mess: Multivariate environmental similarity surfaces (MESS)

Description Usage Arguments Details Value Author(s) References Examples

Description

Compute multivariate environmental similarity surfaces (MESS), as described by Elith et al., 2010

Usage

1
mess(x, v, full=FALSE, filename='', ...)

Arguments

x

Raster* object

v

matrix or data.frame containing the reference values. Each column should correspond to one layer of the Raster* object

full

logical. If FALSE a RasterLayer with the MESS values is returned. If TRUE, a RasterBrick is returned with n layers corresponding to the layers of the input Raster object and an additional layer with the MESS values

filename

character. Output filename (optional)

...

additional arguments as for writeRaster

Details

v can be obtained for a set of points using extract .

Value

A RasterBrick with layers corresponding to the input layers and an additional layer with the mess values (if full=TRUE and nlayers(x) > 1) or a RasterLayer with the MESS values (if full=FALSE).

Author(s)

Jean-Pierre Rossi <jean-pierre.rossi@supagro.inra.fr>, Robert Hijmans, Paulo van Breugel

References

Elith J., M. Kearney M., and S. Phillips, 2010. The art of modelling range-shifting species. Methods in Ecology and Evolution 1:330-342.

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
set.seed(9)
r <- raster(ncol=10, nrow=10)
r1 <- setValues(r, (1:ncell(r))/10 + rnorm(ncell(r)))
r2 <- setValues(r, (1:ncell(r))/10 + rnorm(ncell(r)))
r3 <- setValues(r, (1:ncell(r))/10 + rnorm(ncell(r)))
s <- stack(r1,r2,r3)
names(s) <- c('a', 'b', 'c')
xy <- cbind(rep(c(10,30,50), 3), rep(c(10,30,50), each=3))
refpt <- extract(s, xy)

ms <- mess(s, refpt, full=TRUE)
plot(ms)


## Not run: 
filename <- paste(system.file(package="dismo"), '/ex/bradypus.csv', sep='')
bradypus <- read.table(filename, header=TRUE, sep=',')
bradypus <- bradypus[,2:3]
files <- list.files(path=paste(system.file(package="dismo"),'/ex', sep=''), 
   pattern='grd', full.names=TRUE )
predictors <- stack(files)
predictors <- dropLayer(x=predictors,i=9)
reference_points <- extract(predictors, bradypus)
mss <- mess(x=predictors, v=reference_points, full=TRUE)
plot(mss)

## End(Not run)

dismo documentation built on May 2, 2019, 6:07 p.m.