项目作者: EricMarcon

项目描述 :
Distance Based Measures of Spatial Structures
高级语言: R
项目地址: git://github.com/EricMarcon/dbmss.git
创建时间: 2017-06-22T18:30:25Z
项目社区:https://github.com/EricMarcon/dbmss

开源协议:

下载


" class="reference-link">Distance Based Measures of Spatial Structures

CRAN
version


R-CMD-check
codecov
CodeFactor

dbmss is an R package for simple computation of spatial statistic
functions of distance to characterize the spatial structures of mapped
objects, including classical ones (Ripley’s K and others) and more
recent ones used by spatial economists (Duranton and Overman’s Kd,
Marcon and Puech’s M). It relies on spatstat for some core
calculation.

Installation

You can install the current release of the package from CRAN or the
development version of dbmss from GitHub with:

  1. # install.packages("pak")
  2. pak::pak("EricMarcon/dbmss")

Main functions

The main functions of the package are designed to calculate
distance-based measures of spatial structure. Those are non-parametric
statistics able to summarize and test the spatial distribution
(concentration, dispersion) of points.

The classical, topographic functions such as Ripley’s K are provided
by the spatstat package and supported by dbmss for convenience.

Relative functions are available in dbmss only. These are the $M$ and
$m$ and $K_d$ functions.

The bivariate $M$ function can be calculated for Q. Rosea trees around
V. Americana trees:

  1. library(dbmss)
  2. autoplot(
  3. Mhat(
  4. paracou16,
  5. ReferenceType = "V. Americana",
  6. NeighborType = "Q. Rosea"
  7. ),
  8. main = ""
  9. )

Confidence envelopes

Confidence envelopes of various null hypotheses can be calculated. The
univariate distribution of Q. Rosea is tested against the null
hypothesis of random location.

  1. autoplot(
  2. KdEnvelope(paracou16, ReferenceType = "Q. Rosea", Global = TRUE),
  3. main = ""
  4. )

Significant concentration is detected between about 10 and 20 meters.

Maps

Individual values of some distance-based measures can be computed and
mapped.

  1. # Calculate individual intertype M(distance) value
  2. ReferenceType <- "V. Americana"
  3. NeighborType <- "Q. Rosea"
  4. fvind <- Mhat(
  5. paracou16,
  6. r = c(0, 30),
  7. ReferenceType = ReferenceType,
  8. NeighborType = NeighborType,
  9. Individual = TRUE
  10. )
  11. # Plot the point pattern with values of M(30 meters)
  12. p16_map <- Smooth(
  13. paracou16,
  14. fvind = fvind,
  15. distance = 30,
  16. # Resolution
  17. Nbx = 512,
  18. Nby = 512
  19. )
  20. par(mar = rep(0, 4))
  21. plot(p16_map, main = "")
  22. # Add the reference points to the plot
  23. is.ReferenceType <- marks(paracou16)$PointType == ReferenceType
  24. points(
  25. x = paracou16$x[is.ReferenceType],
  26. y = paracou16$y[is.ReferenceType],
  27. pch = 20
  28. )
  29. # Add contour lines
  30. contour(p16_map, nlevels = 5, add = TRUE)

Vignettes

A quick introduction is in
vignette("dbmss").

A full
documentation

is available on the package website. It is a continuous update of the
paper published in the Journal of Statistical Software (Marcon et al.,
2015
).

Reference

Marcon, E., Traissac, S., Puech, F. and Lang, G. (2015). Tools to
Characterize Point Patterns: dbmss for R. Journal of Statistical
Software
. 67(3): 1-15.