# R and Matlab Dendograms Structures

I know very little about R, but I need to convert the dendrogram resulted from hierarchical clustering in matlab into R dendrogram structure. The following table shows the dendrogram resulted from hierarchical clustering in matlab function; where the first and the second column are the IDs for the objects or branches, and the third column is the distance.

Is there a way to map this table (or matlab dendrogram) into R dendrogram?

## Answers

I think that the easiest way for you to have a dendrogram in R is to use some intermediate results from your matlab analysis instead of using the final table.

Assuming that you have a dissimilarity matrix called Diss_Mat (which you should definitely evaluate at some point of your matlab algorithm), you could do the following

DIST_Mat=as.dist(Diss_Mat) #create a dist type object dendro=as.dendrogram(hclust(DIST_Mat))

where with the second line you perform the hierarchical clustering in R and then you create a dendrogram type object.