Learn R Programming

DataSimilarity (version 0.1.1)

MST: Minimum Spanning Tree (MST)

Description

Calculte the edge matrix of a minimum spanning tree based on a distance matrix, used as helper functions in CCS, CF, FR, and ZC. This function is a wrapper around mstree.

Usage

MST(dists, K = 1)

Value

Object of class neig.

Arguments

dists

Distance matrix as dist object.

K

Component number (default: K = 1).

Details

For more details see mstree.

See Also

CCS, CF, FR, ZC

Examples

Run this code
X1 <- matrix(rnorm(1000), ncol = 10)
X2 <- matrix(rnorm(1000, mean = 0.5), ncol = 10)
dists <- stats::dist(rbind(X1, X2))
if(requireNamespace("ade4", quietly = TRUE)) {
  # MST
  MST(dists)
  # 5-MST
  MST(dists, K = 5) 
}

Run the code above in your browser using DataLab