plot.cvxclust {CCMMR} | R Documentation |
Plot 2D clusterpath
Description
Plot a clusterpath for two-dimensional data.
Usage
## S3 method for class 'cvxclust'
plot(x, col = NULL, labels = NULL, ...)
Arguments
x |
A |
col |
A vector containing cluster membership information. Default is
|
labels |
A vector containing labels for each object. Default is
|
... |
Further graphical parameters. |
Value
A plot in the console.
Examples
# Load data
data(two_half_moons)
data = as.matrix(two_half_moons)
X = data[, -3]
y = data[, 3]
# Get sparse distances in dictionary of keys format with k = 5 and phi = 8
W = sparse_weights(X, 5, 8.0)
# Set a sequence for lambda
lambdas = seq(0, 2400, 1)
# Compute results CMM
res = convex_clusterpath(X, W, lambdas)
plot(res, y + 1)
[Package CCMMR version 0.2 Index]