The {cluster} package uses classes agnes and diana for agglomerative and divisive clustering, respectively, both of which inherit from the twins class, and {stats} provides the conversion function as.hclust().
If there is information in a twins that is lost when converting to hclust, then it may be valuable to write an as_persistence() method for twins or possibly for the two subclasses separately. (If no information is lost, then it's probably fine to expect users to type as_persistence(as.hclust(<twins object>)), but we could also easily do something like as_persistence.twins <- function(x) as_persistence(as.hclust(x)).)
I don't think we should go any further than this, but {cluster} seems to be the most popular clustering package by far.
The {cluster} package uses classes
agnesanddianafor agglomerative and divisive clustering, respectively, both of which inherit from thetwinsclass, and {stats} provides the conversion functionas.hclust().If there is information in a
twinsthat is lost when converting tohclust, then it may be valuable to write anas_persistence()method fortwinsor possibly for the two subclasses separately. (If no information is lost, then it's probably fine to expect users to typeas_persistence(as.hclust(<twins object>)), but we could also easily do something likeas_persistence.twins <- function(x) as_persistence(as.hclust(x)).)I don't think we should go any further than this, but {cluster} seems to be the most popular clustering package by far.