Full spatially-constrained clustering.

scl_full(xy, dmat, ncl, linkage = "single", shortest = TRUE, nnbs = 6L)

Arguments

xy

Rectangular structure (matrix, data.frame, tibble), containing coordinates of points to be clustered.

dmat

Square structure (matrix, data.frame, tibble) containing distances or equivalent metrics between all points in xy. If xy has n rows, then dat must have n rows and n columns.

ncl

Desired number of clusters. See description of `ncl_iterate` parameter for conditions under which actual number may be less than this value.

linkage

Either "single" or "average". For covariance clustering, use "single" with `shortest = FALSE`.

shortest

If TRUE, the dmat is interpreted as distances such that lower values are preferentially selected; if FALSE, then higher values of dmat are interpreted to indicate stronger relationships, as is the case for example with covariances.

nnbs

Number of nearest neighbours to be used in calculating clustering trees. Triangulation will be used if nnbs <= 0.

See also

Other clustering_fns: scl_recluster(), scl_redcap()

Examples

n <- 100
xy <- matrix (runif (2 * n), ncol = 2)
dmat <- matrix (runif (n ^ 2), ncol = n)
scl <- scl_full (xy, dmat, ncl = 4)