Displaying 15 results from an estimated 15 matches for "dend1".
Did you mean:
dendf
2005 Dec 16
2
dendrogram branches with different lty
Dear r-list,
I am trying to visually seperate the two main clusters of a dendrogram.
The idea is to use:
'edgePar=list(lty=3)' for 'dend1[[1]]' and
'edgePar=list(lty=1)' for 'dend1[[2]]'
I have not found a way to solve this. Any suggestions?
Patrick
hc <- hclust(dist(USArrests), "ave")
(dend1 <- as.dendrogram(hc))
par(mfrow=c(2,2))
plot(dend1)
plot(dend1[[1]],edgePar=list(lty=3))
plot(dend1[[2]]...
2011 Dec 12
1
how to colour labels (each label with a colour) in a dendrogram?
...gram each one with a
different colour. How can I do? I guess I could do using *edgetext* and
then *t.col* or* lab.col* but I don't know how to add edgetext to my
dendrogram. Can you help me please?
Example:
require(graphics); require(utils)
hc <- hclust(dist(USArrests), "ave")
(dend1 <- as.dendrogram(hc))
plot(dend1)
labels (USArrests) [[1]] # to know how many cities (labels) = 50
nP <- list(col=3:2, cex=c(2.0, 0.75), pch= 21:22,
bg= c("light blue", "pink"),
lab.cex = 0.75, lab.col = 1:50) # or use a palette:
palette(rainbow(50))...
2005 Jul 11
1
indexing into and modifying dendrograms
...c(4.7,3.1))
plot(pts, xlim = c(0,6), ylim = c(0,4),type = "n",
xlab = "Feature 1", ylab = "Feature 2")
points(pts,pch = as.character(1:5))
## build a hierarhical tree, store as a dendrogram
aggTree <- hclust(dist(pts), method = "single")
(dend1 <- JB.as.dendrogram.hclust(aggTree))
## NOTE: only thing I added to official version of
## as.dendrogram.hclust:
## each node has an attribute cNum, which gives
## the merge step at which it was formed,
## i.e. gives the row of the merge object which
## describes the formation of that node
## on...
2008 Jun 02
1
Plotting horizontal dendrograms
...ct.
Can someone explain why my script does not work.
Sample code follows:
-----------------------------------------------------------------------
# Sample code extracted from the Dendrogram documentation in R
#
require(graphics); require(utils)
hc <- hclust(dist(USArrests), "ave")
(dend1 <- as.dendrogram(hc)) # "print()" method
str(dend1) # "str()" method
str(dend1, max = 2) # only the first two sub-levels
op <- par(mfrow= c(2,2), mar = c(5,2,1,4))
plot(dend1, horiz = TRUE)
plot(dend1)
#
# My code
#
x <- read.table("Rclust2.data",he...
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...
2007 Jun 13
2
Formatted Data File Question for Clustering -Quickie Project
...6 0.051
5/31/1996 0.016 0.000 0.045
6/30/1996 0.015 0.051 0.054
7/31/1996 0.014 0.098 -0.027
8/31/1996 0.013 -0.034 0.036
9/30/1996 0.011 -0.059 0.016
10/31/1996 0.014 0.043 0.017
11/30/1996 0.014 -0.029 0.026
Code Example from Help files:
hc <- hclust(dist(USArrests), "ave")
(dend1 <- as.dendrogram(hc)) # "print()" method
str(dend1) # "str()" method
str(dend1, max = 2) # only the first two sub-levels
op <- par(mfrow= c(2,2), mar = c(5,2,1,4))
plot(dend1)
## "triangle" type and show inner nodes:
plot(dend1, nodePar=list(pch = c(1,N...
2011 Dec 09
1
how to add an edgetext to a dendrogram?
...different labels of my dendrogram. How can I do? I
guess I could to using *edgetext* and then* t.col* or *lab.col* but I don't
know how to add edgetext to my dendrogram. Can you help me please?
Example:
require(graphics); require(utils)
hc <- hclust(dist(USArrests), "ave")
plot(dend1)
labels (USArrests) [[1]] # to know how many cities (labels) = 50
nP <- list(col=3:2, cex=c(2.0, 0.75), pch= 21:22,
bg= c("light blue", "pink"),
lab.cex = 0.75, lab.col = 1:50) # or use a palette:
palette(rainbow(50))
plot(dend1, edgePar=nP, dLeaf=1, e...
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 ?...
2012 Apr 30
2
Generate Dendrogram
...rent color
and want the leaves laying down bottom.
The script like this. I am not familiar with R. I followed the example
shown in
http://stat.ethz.ch/R-manual/R-devel/library/stats/html/dendrogram.html
dist.obj <- as.dist(matrix.distance)
hc.obj <- hclust(dist.obj,method="ave")
dend1 <- as.dendrogram(hc.obj)
plot(hc.obj, xlab='',ylab='',sub='', nodePar=list(pch = c(1,NA),
cex=0.8, lab.cex = 0.8)).
But I got warning and the plot does not look like what I wanted.
Warning messages:
In plot.hclust(hc.obj, xlab = "", ylab = "", sub =...
2002 Mar 05
1
no labels when plotting dendrograms
...39;m having is that when I plot
a dendrogram, I can'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 Dat...
2008 Feb 28
1
Plotting Dendrogram Help Getting Plot to Display Neatly
I have done a cluster analysis doing:
1-clusNorth <-hclust(dist(Artorious)^2, method="ward")
2-clusNorth$labels <-Artorious$Name ## to show the case names and not
numbers
3-dend1 <- as.dendrogram(clusNorth)
4-plot(dend1)
My Dendrogram is now showing the names of my cases in the dataframe on
the x axis
1 OMNICELL INC COM
2 GETTY IMAGES INC COM
3 INTERCONTINENTALEXCHANGE IN COM
4 OPTIONSXPRESS HLDGS INC COM
5 SU...
2013 May 01
1
help understanding hierarchical clustering
...!is.na(mat$count) &
!is.na(mat$subs),]
distmat<-vegdist(dd)
clusa<-hclust(distmat,"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...
2004 May 19
7
Help with hclust() and plot()
Hi
When I use plot(hclust(dist..)...)...) etc to create a dendrogram of a
hierarchial cluster analysis, I end up with a vertical tree. What do I
need to do to get a horizontal tree?
Also, my users are used to seeing trees who's leaves all "end" at the
same place (eg. Like in minitab). Is this possible in R?
Thanks
Mick
Michael Watson
Head of Informatics
Institute for Animal
2012 Oct 24
0
recursive function on a structured list of lists (dendrogram)
...sing list at the same time. In dendrogram-speech I basically would like the label of the leaf and the height of the enclosing branch.
A dendrogram example (from the help file of stats::dendrogram), and some functions showing how it is structured:
hc <- hclust(dist(USArrests), "ave")
dend1 <- as.dendrogram(hc)
plot(dend1)
str(dend1)
Similarly to dendrapply(), I tried o recursively obtain from the tree a list including, for each member (leaf) the height of the list containing it. However, I fail to fully grasp how the 'recursiveness' is made within the function saving both...
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