nncorr),
  the nearest-neighbour mark index (nnmean),
  and the nearest-neighbour variogram index (nnvario).nncorr(X,
            f = function(m1, m2) { m1 * m2 },
            ...,
            use = "all.obs", method = c("pearson", "kendall", "spearman"),
            denominator=NULL)
     nnmean(X)
     nnvario(X)"ppp".X.f.cor.  The command nncorr computes the nearest neighbour correlation index
  based on any test function f provided by the user.
  The default behaviour of nncorr is to compute the
  nearest neighbour mark product index.
  The commands nnmean and nnvario are
  convenient abbreviations for other special choices of f.
  In the default case, nncorr(X) computes three different
  versions of the nearest-neighbour correlation index:
  the unnormalised, normalised, and classical correlations.
  [object Object],[object Object],[object Object]
  In the default case where f is not given,
  nncorr(X) computes
  
Xare real numbers, 
    the unnormalised and normalised
    versions of the nearest-neighbour product index$E[M \, M^\ast]$,
    and the classical correlation
    between$M$and$M^\ast$.Xare factor valued,
    the unnormalised and normalised
    versions of the nearest-neighbour equality index$P[M = M^\ast]$.  The wrapper functions nnmean and nnvario
  compute the correlation indices for two special choices of the
  function $f(m_1,m_2)$.
  
nnmeancomputes the correlation indices for$f(m_1,m_2) = m_1$. The unnormalised index
    is simply the mean value of the mark of the neighbour of a typical point,$E[M^\ast]$, while the normalised index is$E[M^\ast]/E[M]$, the ratio of the mean mark of the
    neighbour of a typical point to the mean mark of a typical point.nnvariocomputes the correlation indices for$f(m_1,m_2) = (1/2) (m_1-m_2)^2$.  The argument X must be a point pattern (object of class
  "ppp") and must be a marked point pattern.
  (The marks may be a data frame, containing several columns of mark variables;
  each column is treated separately.)
  If the argument f is given, it
  must be a function, accepting two arguments m1
  and m2 which are vectors of equal length containing mark
  values (of the same type as the marks of X).
  It must return a vector of numeric
  values of the same length as m1 and m2.
  The values must be non-negative.
  The arguments use and method control
  the calculation of the classical correlation using cor,
  as explained in the help file for cor.
  Other arguments may be passed to f through the ...
  argument.
  
  This algorithm assumes that X can be treated
  as a realisation of a stationary (spatially homogeneous) 
  random spatial point process in the plane, observed through
  a bounded window.
  The window (which is specified in X as X$window)
  may have arbitrary shape.
  Biases due to edge effects are
  treated using the 
data(finpines)
  nncorr(finpines)
  # heights of neighbouring trees are slightly negatively correlated
  data(amacrine)
  nncorr(amacrine)
  # neighbouring cells are usually of different typeRun the code above in your browser using DataLab