Hi all I’m James. This is my first blog for Coppelia. Thanks to Simon for encouraging me to do this.
I’ve been doing a lot of hierarchical clustering in R and have started to find the the standard dendrogram plot fairly unreadable once you have over a couple of hundred records. I’ve recently been introduced to the D3.js gallery and I wondered if I could hack something better together. I found this dendrogram I liked and started to play. I soon realised in order to get my data into it I needed a nested json.
The R code is made up of two functions. 1) HCtoJSON which converts the hclust output into a JSON and 2) D3Dendo which takes the JSON and creates an HTML file of the dendagram. It’s nice and simple and creates the following dendagram.
I’m also thinking of other places to use D3 and might put together an R package in a similar style.