Hi all,
I'm having a problem where by I'm trying to use the NeatMap
draw.dendrogram
function as it is more versatile in placement/direction of dendrograms,
instead of the limited plot function.
Using plot I can get my dendrograms to display the species name for each
leaf of the tree. But I cannot figure out how to make this happen using
draw.dendrogram..
genetic<- read.csv("genetic.csv")
genetic
genetic<- as.matrix(genetic)
gen.dist <- as.dist(genetic)
speciesnames<- spp.by.chem[,1]
# perform hierarchical clustering on the gen.dist matrix, and plot the tree
gen.hc <-hclust(gen.dist)
gen.hc$labels <- speciesnames
#plot works fine but doesn't point the dendrogram in the right direction for
what I want to do.
plot(as.dendrogram(gen.hc), type = c("rectangle"), center = FALSE,
xaxt "s", yaxt = "s", horiz = TRUE, axes = FALSE)
#so using NeatMaps functions I get a tree pointing in the right direction
but without leaf labels i.e. no species names.
ggplot()+draw.dendrogram(gen.hc, leaf.order=NULL, dendro.dir =
"right")+
opts(panel.grid.major = theme_line(size = 0, colour = NA), panel.grid.minor
= theme_line(colour = NA), panel.background = theme_rect(colour = NA),
axis.title.y = theme_blank(), axis.title.x = theme_blank(), axis.text.x
theme_blank(), axis.text.y = theme_blank(),axis.ticks = theme_blank())
Any ideas from gurus welcomed!
Regards,
Mikey
--
View this message in context:
http://r.789695.n4.nabble.com/neatmap-draw-dendrogram-help-tp4634805.html
Sent from the R help mailing list archive at Nabble.com.