Title: | Interactive Dendrograms for Visualizing Hierarchical Clusters with Prototypes |
---|---|
Description: | Shiny app to interactively visualize hierarchical clustering with prototypes. For details on hierarchical clustering with prototypes, see Bien and Tibshirani (2011) <doi:10.1198/jasa.2011.tm10183>. This package currently launches the application. |
Authors: | Andee Kaplan [aut, cre], Jacob Bien [aut], Mike Bostock [cph] (Author of included d3.js library), Brian Reavis [cph] (Author of included selectize.js library) |
Maintainer: | Andee Kaplan <[email protected]> |
License: | GPL-3 |
Version: | 0.1.0 |
Built: | 2025-03-11 03:45:48 UTC |
Source: | https://github.com/andeek/protoshiny |
Convert a generic hclust object to a protoclust object.
as.protoclust(hc, protos)
as.protoclust(hc, protos)
hc |
A generic hclust object using any linkage. |
protos |
A vector of prototype label indices for each branch in the dendrogram. The i-th element is the index of the prototype corresponding to the cluster formed on the i-th merge. |
An object of class protoclust
with a user specified vector of representative prototypes for each cluster.
This object is just like hclust
but has an identical element:
merge , height , order
|
identical to the values returned by |
protos |
a vector of length n - 1. The i-th element is the index of the prototype corresponding to the cluster formed on the i-th merge. |
This is a protoclust object for use with protoshiny. It is the hierarchical clustering of US counties using mobility data (proportion of people staying home at least 8 hours and proportion of people going into a restaurant).
https://cmu-delphi.github.io/covidcast/covidcastR/
This is a protoclust object for use with protoshiny. It is the hierarchical clustering of 400 grayscale images of faces that correspond to 10 images of 40 individuals.
https://www.kaggle.com/kasikrit/att-database-of-faces
Extract cluster labels
get_clusters(hc)
get_clusters(hc)
hc |
A protoshiny object downloaded from the web interface. |
A vector of saved cluster assignments resulting from interaction in the protoshiny application.
This function expects a set of node id's of a hierarchical clustering object that would define a partition of the leaves. It returns a vector giving the implied clustering of the leaves (analogous to the output of 'stats::cutree').
get_cut_from_merge_id(hc, merge_id)
get_cut_from_merge_id(hc, merge_id)
hc |
An object of class 'hclust' |
merge_id |
A numeric vector. Indexing of nodes should match that of the 'merge' matrix in an 'hclust' object. In particular, positive numbers specify interior nodes and negative numbers specify leaves. These nodes must define a partition of the leaves, meaning no node in 'merge_id' should be a descendant of another and every leaf should either be included directly or be the descendant of one of the interior nodes referenced by 'merge_id'. |
This function returns the binary path from root to node for each node that should be displayed in order to return the input clustering. Note that this will only be possible for a clustering 'cl' in which each cluster corresponds to a branch of 'hc'.
get_paths_from_cut(hc, cl)
get_paths_from_cut(hc, cl)
hc |
An object of class 'hclust' |
cl |
A numeric vector in the format of the output of 'stats::cutree' that gives the cluster memberships of each leaf. |
This is a protoclust object for use with protoshiny. It is the hierarchical clustering of 13,816 movies based on users' ratings and taggings of movies.
https://grouplens.org/datasets/movielens/25m/
This is a protoclust object for use with protoshiny. It is the hierarchical clustering of 6,336 scatterplots resulting from continuous-time flow cytometry measurements of phytoplankton.
Provided by Mattias Rolf Cape and Francois Ribalet.
Run a local instance of protoshiny
visualize_hc()
visualize_hc()
No return value, launches the protoshiny Shiny application.
## Not run: visualize_hc() ## End(Not run)
## Not run: visualize_hc() ## End(Not run)
This is a protoclust object for use with protoshiny. It is the hierarchical clustering of 19,599 of the most common words from Grolier's Encyclopedia.
https://cs.nyu.edu/~roweis/data.html