similarity: Calculate Multivariate Environmental Similarity

Description Usage Arguments Details Value References Examples

View source: R/similarity.R

Description

Calculate Multivariate Environmental Similarity and most dissimilar/similar variables with respect to a reference dataset, for a set of environmental variables.

Usage

1
similarity(x, ref, full = FALSE)

Arguments

x

a Raster*, list, matrix, or data.frame where each layer/column/element represents focal values of an environmental variable.

ref

a list, matrix, or data.frame where each column/element represents reference values for an environmental variable (corresponding to those given in x).

full

(logical) should similarity values be returned for all variables? If FALSE (the default), then only the minimum similarity scores across variables will be returned.

Details

similarity uses the MESS algorithm described in Appendix S3 of Elith et al. 2010.

Value

If x is a Raster* object, this function returns a list containing:

If x is a list, matrix, or data.frame, the function will return a list as above, but with RasterStack and Raster objects replaced by matrix and vectors.

References

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library(dismo)
library(raster)
ff <- list.files(system.file('ex', package='dismo'), '\\.grd$', 
                 full.names=TRUE )
predictors <- stack(grep('biome', ff, value=TRUE, invert=TRUE))
occ <- read.csv(system.file('ex/bradypus.csv', package='dismo'))[, -1]
ref <- extract(predictors, occ)
mess <- similarity(predictors, ref, full=TRUE)

## Not run: 
library(rasterVis)
library(RColorBrewer)
levelplot(mess$mod, col.regions=brewer.pal(8, 'Set1'))
levelplot(mess$mos, col.regions=brewer.pal(8, 'Set1'))

## End(Not run)

johnbaums/rmaxent documentation built on July 3, 2020, 5:36 p.m.