Multivariate environmental similarity surfaces (MESS)
Compute multivariate environmental similarity surfaces (MESS), as described by Elith et al., 2010
mess(x, v, full=FALSE, filename='', ...)
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 |
filename |
character. Output filename (optional) |
... |
additional arguments as for |
v
can be obtained for a set of points using extract
.
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
).
Jean-Pierre Rossi <jean-pierre.rossi@supagro.inra.fr>, Robert Hijmans, Paulo van Breugel
Elith J., M. Kearney M., and S. Phillips, 2010. The art of modelling range-shifting species. Methods in Ecology and Evolution 1:330-342.
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)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.