Question

I have clustering code written in Java, from which I can create a nested tree structure, e.g. the following shows a tiny piece of the tree where the two "isRetired" objects were clustered in the first iteration, and this group was clustered with "setIsRequired" in the fifth iteration. The distances between the objects in the clusters are shown in parentheses.

  |+5 (dist. = 0.0438171125324851)
    |+1 (dist. = 2.220446049250313E-16)
      |-isRetired
      |-isRetired
    |-setIsRetired

I would prefer to present my results in a more traditional dendrogram style, and it looks like R has some nice capabilities, but because I know very little about R, I am unclear on how to take advantage of them.

Is it possible for me to write out a tree structure to a file from Java, and then, with a few lines of R code, produce a dendrogram? From the R program, I'd like to do something like:

  1. Read from a file into a data structure (an "hclust" object?)
  2. Convert the data structure into a dendrogram (using "as-dendrogram"?)
  3. Display the dendrogram using "plot"

I guess the question boils down to whether R provides an easy way of reading from a file and converting that string input into an (hclust) object. If so, what should the data in the input file look like?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top