search for: dend2

Displaying 8 results from an estimated 8 matches for "dend2".

Did you mean: dendf
2005 Jul 11
1
indexing into and modifying dendrograms
...ly rather associate with the node than the edge ## but current plotting function has no notion of nodetext addE <- function(n) { if(!is.leaf(n)) { attr(n, "edgePar") <- list(p.col="plum") attr(n, "edgetext") <- attr(n,"cNum") } n } dend2 <- dendrapply(dend1, addE) ## overlays the cNum ("cluster number") attribute on dendrogram plot(dend2, main = "dend2") ## why does no plum polygon appear around the '4' for the root ## edge? ## swap order of clusters 2 and 3, ## i.e. 'flip' cluster 4 dend3 &l...
2007 Jun 13
2
Formatted Data File Question for Clustering -Quickie Project
...quot;triangle" type and show inner nodes: plot(dend1, nodePar=list(pch = c(1,NA), cex=0.8, lab.cex = 0.8), type = "t", center=TRUE) plot(dend1, edgePar=list(col = 1:2, lty = 2:3), dLeaf=1, edge.root = TRUE) plot(dend1, nodePar=list(pch = 2:1,cex=.4*2:1, col = 2:3), horiz=TRUE) dend2 <- cut(dend1, h=70) plot(dend2$upper) ## leafs are wrong horizontally: plot(dend2$upper, nodePar=list(pch = c(1,7), col = 2:1)) ## dend2$lower is *NOT* a dendrogram, but a list of .. : plot(dend2$lower[[3]], nodePar=list(col=4), horiz = TRUE, type = "tr") ## "inner" and &quo...
2011 Jan 25
1
dendrogram plot does not draw long labels ?
Hello, It seems that the plot function for dendrograms does not draw labels when they are too long. > hc <- hclust(dist(USArrests), "ave") > dend1 <- as.dendrogram(hc) > dend2 <- cut(dend1, h=70) > dd <- dend2$lower[[1]] > plot(dd) # first label is drawn > attr(dd[[1]], "label") <- "aaaaaaaaaaaaaaaaaa" > plot(dd) # first label is NOT drawn Is this expected ? Is it possible to force the drawing ? Thank you, Karl [[alternative...
2007 Oct 26
2
cut.dendrogram and cutree
Hi! In the example: hc <- hclust(dist(USArrests), "ave") dend1 <- as.dendrogram(hc) dend2 <- cut(dend1, h=70) Do the branches "Branch 1", "Branch 2", "Branch 2"...in dend2$upper str(dend2$upper) --[dendrogram w/ 2 branches and 4 members at h = 152] |--[dendrogram w/ 2 branches and 2 members at h = 77.6] | |--leaf "Branch 1" (h= 38.5...
2002 Mar 05
1
no labels when plotting dendrograms
...39;t figure out how to add labels to the nodes. For example, this example from the dendrogram documentation plots a dendrogram without labels: library(mva) data(USArrests) hc <- hclust(dist(USArrests), "ave") str(dend1 <- as.dendrogram(hc)) plot(dend1) dend2 <- cut(dend1, h=70) plot(dend2$upper) plot(dend2$lower[[3]]) So... does anyone know how to cut an hclust object and get a list of hclust objects, or how to plot a dendrogram object with labels? Thanks. David Marimont NXP Data Analysis, Inc. http://www.nxpdata.com -.-.-.-....
2016 Apr 17
0
use hjust or vjust with dendextend
Following "Introduction to dendextend" from Tal Galili, I applied this code on iris data: ## library(dendextend) library(dendextendRcpp) library(ggplot2) dend2 <- iris[1:30,-5] %>% dist %>% hclust %>% as.dendrogram %>% set("branches_k_color", k=3) %>% set("branches_lwd", rep(1,4)) %>% set("branches_lty", rep(1,6)) %>% set("labels_colors") %>% set("labels_cex", c(1.0,1.0)) %&gt...
2012 May 24
4
Manually modifying an hclust dendrogram to remove singletons
Dear R-Help, I have a clustering problem with hclust that I hope someone can help me with. Consider the classic hclust example: hc <- hclust(dist(USArrests), "ave") plot(hc) I would like to cut the tree up in such a way so as to avoid small clusters, so that we get a minimum number of items in each cluster, and therefore avoid singletons. e.g. in this example, you can see
2013 May 01
1
help understanding hierarchical clustering
...t,"average") print(clusa) Call: hclust(d = distmat, method = "average") Cluster method : average Distance : bray Number of objects: 8036 print(dend1 <- as.dendrogram(clusa)) 'dendrogram' with 2 branches and 8036 members total, at height 0.3194225 dend2 <- cut(dend1, h=0.07) a complete run with plots is available here : http://nbviewer.ipython.org/5492912 i'm trying try to group together the species (idcode's) that are sharing similar environmental parameters like (looking at the plots) i should be able to retrieve the list of id...