emd: Earth movers distance

Description Usage Arguments Value Author(s) References Examples

Description

Calculates the disimilairty, measured as the earth movers distance.

Usage

1
2
3
4
  ## S4 method for signature 'SpatialPoints,SpatialPoints'
emd(x,y, gc = FALSE, threshold = NULL,...)
  ## S4 method for signature 'RasterLayer,RasterLayer'
emd(x,y, ...)

Arguments

x

A Raster, Raster stack/brick or SpatialPoints object, it is also possible to provide UD objects. In case of spatial points data frame the first columns of data is used as weights. In case of SpatialPoints all points are weighted equally.

y

A Raster or SpatialPoints.

gc

True if great circle distances should be used.

threshold

The maximal distance over which locations are compaired.

...

Currently not used

Value

An dist object is returned

Author(s)

Bart Kranstauber

References

Kranstauber, B., Smolla, M., Safi,K., Similarity in spatial utilization distributions measured by the Earth Mover's Distance.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  data(dbbmmstack)
  values(dbbmmstack)[values(getVolumeUD(dbbmmstack))>.999999]<-0
  stk<-(dbbmmstack/cellStats(dbbmmstack,sum))
  emd(stk[[1]],stk[[2]])
  emd(stk)
  emd(stk, threshold=10000)
  x<-SpatialPointsDataFrame(cbind(c(1:3,5),2), data=data.frame(rep(.25,4)))
  y<-SpatialPointsDataFrame(coordinates(x), data.frame(c(0,.5,.5,0)))
  emd(x,y)
  emd(x,y,threshold=.1)


Search within the move package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.