This function builds and counts the number of all types of ordered couples in a data vector or matrix,
according to a chosen adjacency matrix. 'Ordered' means that a couple (i,j) is
different than a couple (j,i).
Usage
couple_count(data, adj.mat, missing.cat = NULL)
Arguments
data
A matrix or vector, can be numeric, factor, character...
If the dataset is a point pattern, data is the mark vector.
adj.mat
An adjacency matrix, upper- or lower-triangular. Provided by user or generated by adj_mat.
missing.cat
A vector with the names of all categories that are absent in data.
Value
The number of couples, and a table with absolute and relative frequencies
for each couple of categories.
Details
This function needs a data matrix or data vector of any type (numeric, factor, character, ...),
and an adjacency matrix as generated by adj_mat(). It returns all the data couples
identified by the adjacency matrix, i.e. occurring at the chosen neighbourhood distance.
Relative and absolute frequencies for all possible couples are returned, and may be used
for computation of spatial entropy at the chosen distance range.
'Ordered' means that the relative spatial location is relevant, i.e. that a couple
where category \(i\) occurs at the left of category \(j\) is different from a couple
where category \(j\) occurs at the left of category \(i\).