gen_chull | R Documentation |
Supplements a data set with information needed to draw a convex hull.
gen_chull(data, cl)
data |
data set |
cl |
numeric vector of cluster labels |
list with convex hull containing points and edges
data(clusters)
cl_dist <- dist(clusters[,1:5])
cl_hw <- hclust(cl_dist, method="ward.D2")
cl_w <- cutree(cl_hw, 3)
cl_chull <- gen_chull(clusters[,1:5], cl_w)
if (interactive()) {
require(tourr)
animate_xy(cl_chull$data[,1:5],
col=cl_chull$data[,6],
edges=cl_chull$edges,
edges.col=cl_chull$edge_clr,
axes="bottomleft")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.