This function computes competition indices based on pairs of plants, ignoring higher-order interactions.
pairwise(plants, maxN = NULL, maxR = NULL, select = NULL, selpar =
NULL, kernel, kerpar = NULL)
A spatstat point pattern object (class ppp
). It contains the plants coordinates, and marks with the plant size and possibly other attributes.
Maximum number of nearest neighbors to include as potential competitors. Default is NULL (no restriction).
Maximum radius to search for potential competitors. Default is NULL (no restriction).
Optional user-supplied selection function for choosing competitors. Must take arguments (imarks, jmarks, dists, dranks)
or (imarks, jmarks, dists, dranks, par)
, where imarks
are the marks for the subject plant (a 1-row data frame), jmarks
is a data frame with the marks of the potential competitors, dists
is a vector distances between subject plant and the potential competitors, dranks
are the distance ranks, and par
receives the value of the selpar
argument if not NULL
. It must return a logical vector with the same length as dists
. Examples are provided in the functions powlinear_sel()
, etc. (see select). Default is NULL (no selection).
Parameter(s) for select
, usually a list or vector. Default: NULL.
Competition kernel function for computing the effect of competitor \(j\) on the subject plant \(i\). Must yake arguments (imarks, jmarks, dists, dranks)
or (imarks, jmarks, dists, dranks, par)
, where imarks
are the marks for the subject plant (a 1-row data frame), jmarks
is a data frame with the marks of the potential competitors, dists
is a vector of distances between subject plant and the potential competitors, dranks
are the distance ranks, and par
receives the value of the kerpar
argument if not NULL
. It must return a numeric vector with the same length as dists
. Examples are provided in the functions powers_ker()
, etc. (see kernel).
Parameter(s) for kernel
, usually a list or vector. Default: NULL.
Returns the input point pattern plants
, with the marks replaced by a data frame containing the original marks followed by the competition index in a column named cindex
.
Traditionally, the competition index for a subject plant \(i\) is obtained in two stages: (1) Choose a set of competitors of \(i\) by some selection rule. (2) Compute a measure of the effect of each competitor \(j\) on plant \(i\), and add over \(j\). This effect of \(j\) on \(i\) is normally a function of the sizes of both plants and of the distance between them, which we call a competition kernel. The kernel may depend on other plant attributes, like species, and in some rare instances on the distance ranks or on the number of competitors. Conceptually, the first stage is not strictly necessary, it could be replaced by specifying zero kernel values (the effect of the selection is usually to truncate the kernel function beyond some distance). However, a separate selection rule may be more transparent, and may reduce the computational effort in searching for neighbors.
Some simple selection rules can be implemented by giving a value to maxN
and/or maxR
. In any case, reasonable limits on these variables may be advisable for reducing computation.
More complex rules can be specified by the select
function, with parameters in selpar
. See select
for examples. If more than one of maxN
, maxR
or select
are given, the intersection of the selection criteria is used.
Kernel computation is specified by the kernel
function and the parameters in kerpar
. See kernel
for examples.
https://github.com/ogarciav/siplab
Garc<U+00ED>a, O. “Siplab, a spatial individual-based plant modelling system”. Computational Ecology and Software 4(4), 215-222. 2014.
# NOT RUN {
# Hegyi (1974) index (no distance offset, as usual)
summary(pairwise(finpines, maxR = 6, kernel=powers_ker))
# }
Run the code above in your browser using DataLab