# Cluster similarity percentages with inverted Y-axis in R [closed]

I'd like to ask a question here that I've also asked on Biostar (stackexchange) and someone there forwarded me to this website. I was wondering how I could perform a Bray Curtis similarity clustering in R in which I show the similarity percentages on an inverted Y-axis and all tree nodes ending at 100% as I've shown in a dendogram: At the moment I create my plot in the following way (using S17 Bray Curtis dissimilarity measure, which just scales regular Bray Curtis to 0-100%):

library(vegan)
mat = 'some matrix'
d = (1 - vegdist(mat, method="bray")) * 100
h = hclust(d)
plot(h)


Inverting the Y-axis (with ylim=c(100,80)) doesn't work. How can I create a dendogram as shown above from a distance matrix? Thanks for any help / advice!

Original question can be found on the Biostar website here

• I have imported the picture from BioStar.
– user88
Oct 17 '11 at 11:55
• @Fucitol, you should add the link between the two questions, if people are interested in the question they will want to see the answers from both sites (if you do get answers from either site). Oct 17 '11 at 12:07

I'm think the answer on the Biostars web site is wrong. Looking at the dendrogram on Biostars, you can see three Merc450 car models that appear in completely different clusters, when in fact these cars are almost exactly the same. Here's a way to label the vertical axis with 100 down to 0. Note the Merc450 cars near the left side of the dendrogram.

mat = mtcars
library(vegan)
d1 <- vegdist(mat, method="bray") # range .001 .633
h1 <- hclust(d1)
# This plot agrees with the corrgram
plot(h1,
axes=FALSE, hang = -1,
xlab="", ylab="Similarity",
main = "mtcars - Bray Curtis method", sub = "")
# h1$$height has the heights of join points # original scale was [0, .63] axis(side=2, at=seq(0, max(h1$$height), length=6), labels=seq(100,0,-20)) 