melsa  R Documentation 
Calculate ELSA statistic for multivariate categorical or continuous spatial dataset.
melsa(x,d,nc,categorical,dif,classes,stat,...)
x 
a multilayer raster object ( 
d 
numeric local distance 
nc 
optional, for continuous data it specifies the number of classes through categorizing the variable. If missing, it is automatically calculated (recommended) 
categorical 
logical, specified whether x is a continuous or categorical. If missed the function tries to detect it 
dif 
the difference between categories, only for categorical 
classes 
Optional, only when 
stat 
specifies which statistic should be calculated by the function; it can be "elsa" (default), or either of the two components of the statistic, "Ea", or "Ec"; ELSA is the product of Ea and Ec. (it is possible to select more than one statistic); this argument is ignored if 
... 
additional arguments including:

dif can be used when categorical values are sorted into hierarchical system (e.g., CORINE land cover). This make it possible to difine different weights of similarity between each pairs of categories when the level of similarity is not the same between different classes in the variable. For example, two categories belong to two forest types are more similar than two categories, one a forest type and the other one an agriculture type. So, it can take this differences into account when the spatial autocorrelation for categorical variables is quantified.
the ELSA statistics has two terms, "Ea" and "Ec", in the reference. It can be specified in the stat
argument if either of these terms should be returned from the function or ELSA ("E"), which is the product of these two terms, Ea * Ec
. All three terms can also be selected.
SpatRaster 
Babak Naimi naimi.b@gmail.com
Naimi, B., Hamm, N. A., Groen, T. A., Skidmore, A. K., Toxopeus, A. G., & Alibakhshi, S. (2019). ELSA: Entropybased local indicator of spatial association. Spatial statistics, 29, 6688.
file < system.file('external/dem_example.grd',package='elsa')
#r < rast(file)
#plot(r, main='a continuous raster map')
#e < elsa(r,d=2000,categorical=FALSE)
#plot(e)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.