Learn R Programming

gSeg (version 1.1)

gseg_kmst: Construct a k-MST Similarity Graph

Description

Constructs the k-MST used by default in the data-level gSeg interface.

Usage

gseg_kmst(x = NULL, dissimilarity = NULL, k = NULL)

Value

A two-column edge matrix containing the union of the first k MST layers.

Arguments

x

Optional data matrix with observations in rows.

dissimilarity

Optional square dissimilarity matrix or a dist object. Supply exactly one of x and dissimilarity.

k

Number of complete MST layers. The default is floor(sqrt(N)); the largest allowed value is floor(N/2).

Examples

Run this code
set.seed(1)
x <- matrix(rnorm(60), nrow = 20)
E <- gseg_kmst(x = x)
attr(E, "k")

Run the code above in your browser using DataLab