[R] Bug in plot.dendrogram, and how to submit patches

Yan Wong yan at pixie.org.uk
Sat Nov 8 15:15:13 CET 2008


Before submitting a bug report, I thought I would ask here, as  
recommended in http://www.r-project.org/posting-guide.html.

Using R 2.8.0 under Mac OS X, I find that edge labels are misplaced  
when doing plot.dendrogram(..., horiz=TRUE), for example

 > sessionInfo()
R version 2.8.0 (2008-10-20)


attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base
 > d <- as.dendrogram(hclust(dist(list(a=1,b=2,c=4,d=5))))
 > attr(d[[1]], "edgetext") <- "a & b"
 > attr(d[[2]], "edgetext") <- "c & d"
 > plot(d, horiz="F") #OK
 > plot(d, horiz="T") #edge labels do not change position to account  
for horiz

I think this is because stats:::plotNode doesn't deal with horiz=TRUE  
on line 152 (starting "polygon(mx + c(-hl3, hl3),").

I'm quite happy to submit a patch to fix this, but I'm not sure how  
to do so. Is there a web page which gives details about the preferred  
format for patches, and how to download the latest code for patching?  
I guess I initially need to download the latest SVN repository, but  
I'm a bit of a novice at this, and some instructions about how to go  
about it would be quite handy.


Yan Wong

More information about the R-help mailing list