gplot: gplot

Description Usage Arguments Details Value Examples

Description

Plot an hdbscan object, using ggplot. The plot is primarily intended for diagnostic purposes, but can be useful to undertand how clusters were generated.

Usage

1
gplot(x, coords, text = FALSE, distances = FALSE)

Arguments

x

An hdbscan object.

coords

Coordinates for the points clustered in x.

text

If TRUE, include on the plot labels for each node's index. If "parent", the labels will instead be the index number of the node's cluster.

distances

If TRUE, draw circles representing the core distances around each point.

Details

Point color corresponds to clusters, with outliers as the NA color. Alpha corresponds to the node's GLOSH score. The segments on the plot correspond to the connections on the minimum spanning tree. Segment alpha corresponds to λ_p.

If the parameter text is set to TRUE or "parent", the nodes will be labelled with the node index number or cluster index number, respectively.

Value

A ggplot object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
library(largeVis)
# The aggregation dataset can be downloaded from https://github.com/elbamos/clusteringdatasets
data(Aggregation)
dat <- as.matrix(Aggregation[, 1:2])
aggregateVis <- largeVis(dat, K = 10, tree_threshold = 100,
                         max_iter = 5, sgd_batches = 1)
clusters <- hdbscan(aggregateVis, verbose = FALSE)
gplot(clusters, dat)

## End(Not run)

elbamos/largeVis documentation built on May 16, 2019, 2:58 a.m.