hclust_to_seg.RdCovert hclust objects to segments for use in ggplots
hclust_to_seg(hc, tree.dir = "down", dir.lims = c(0, 1))a hclust object (hierarchical clustering, stats package). First convert df to distances (dist(df)) then hclust(df)
a character object with the direction the tree points to, from root to leaves. options are "down" (default), "up","left", "right".
a 2-member vector with the space in the direction of plotting that the dendrogram will occupy. default = c(0,1)
a data.frame with segment values for ggplot2's geom_seg. columns: "x","xend","y","yend".