R function from {stats} package - hierarchical cluster analysis on a set of dissimilarities and methods for analyzing it.
Questions tagged [hclust]
176 questions
1
vote
2 answers
How to convert data.frame into distance matrix for hierarchical clustering?
I have a data frame defined in a format of distance matrix:
> df
DA DB DC DD
DB 0.39 NA NA NA
DC 0.44 0.35 NA NA
DD 0.30 0.48 0.32 NA
DE 0.50 0.80 0.91 0.7
I want to use it as distance matrix in hclust function. But when I try…

umair durrani
- 5,597
- 8
- 45
- 85
1
vote
1 answer
How to plot an nmds with coloured/symbol points based on SIMPROF
Hi so i am trying to plot my nmds of a assemblage data which is in a bray-curtis dissimilarity matrix in R. I have been able to apply ordielipse(),ordihull() and even change the colours based on group factors created by cutree() of a hclst()
e.g…

Lmm
- 403
- 1
- 6
- 24
1
vote
1 answer
The 'height' component of 'tree' is not sorted Error in cutree
I am trying to do some grouping and am encountering this error.
Evaluation error: the 'height' component of 'tree' is not sorted (increasingly).
My input is:
library(stringdist)
name <-…

Ravonrip
- 584
- 1
- 7
- 17
1
vote
1 answer
ANOSIM with cutree groupings
What i would like to do is an ANOSIM of defined groupings in some assemblage data to see whether the groupings are significantly different from one another, in a similar fashion to this example code:
data(dune)
data(dune.env)
dune.dist <-…

Lmm
- 403
- 1
- 6
- 24
1
vote
1 answer
cor_cophenetic behavior in randomizations
I am working in R, with the dendextend package, trying to compare hclusts objects with cop_cophenetic.
I have two objects that rise from clustering: clusts and clusts1, and I want to compare the cophenetic correlation between them. I have a few…

erezgrn
- 11
- 1
1
vote
1 answer
What is the difference between segments(from segmentation) and classes( from Hierchical Clustering)
I am working on meanshift segmentation using R! I am now abit confused!my first question is how I can cluster the segmentation file( defining each segment as a super pixel) and second how I can then define that how many objects and how many classes…

Oumnia Asadian
- 39
- 8
1
vote
0 answers
hclust, dist in R explained methods for clustering words
I'm working with some tweet data using the twitter API and OAUTH. I am making a cluster dendrogram to cluster words used in 500 tweets. I am not exactly sure how the hclust function is clustering the words. i.e by what rules I need some logic…

CodeHawk
- 11
- 2
1
vote
1 answer
Get the cut heights using identify.hclust()
I am manually cutting a dendrogram created from hclust in R using identify.hclust.
The default return of the function is the IDs of observations in each group.
I need this information, but I also need to know the height of this group. Is there any…

Oligg
- 375
- 3
- 19
1
vote
1 answer
plot a very large data with many zeros
This is a small portion of a vey big data
df<- structure(list(A = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0.68906, 0, 0, 0, 0, 0, 0, 0, 0, 0.13597, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0), B = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0,…

user 127354
- 45
- 6
1
vote
1 answer
How to cut a dendrogram in r
Okay so I'm sure this has been asked before but I can't find a nice answer anywhere after many hours of searching.
I have some data, I run a classification then I make a dendrogram.
The problem has to do with aesthetics, specifically; (1) how to cut…

Tzac
- 101
- 2
- 12
1
vote
1 answer
Use hclust on upper triangle in R
I have a matrix like so:
a b c
a 1 3 4
b 3 1 2
c 4 2 1
Is it possible to use hclust on the upper triangle without splicing the matrix diagonally?
structure(c(1, 3, 4, 3, 1, 2, 4, 2, 1), .Dim = c(3L, 3L), .Dimnames = list(c("a", "b", "c"), c("a",…

motiur
- 1,640
- 9
- 33
- 61
1
vote
1 answer
How to adjust the color range in heatmap.2
I am trying to plot the heatmap using the R language.
After plotting the heatmap graph, I found that the my heatmap was not appropriate for the interpretation because the range of the color key was not well adjusted.
As you can see below, the color…

sclee1
- 1,095
- 1
- 15
- 36
1
vote
0 answers
See distance matrix in each step of hclust
How can see distance matrix in any step of the hierarchical clustering algorithm(use hclust function in R)?

amin roshani
- 389
- 4
- 11
1
vote
1 answer
r: Obtaining final cluster results in a table/ dataframe when using hclust()
I am conducting a hierarchical cluster analysis by using hclust()
The code looks like this:
hc <- hclust(dist(USArrests), "ave")
Now, all I need is to get a table (or something equivalent) which contains all clusters and the observations (by their…

Jonathan Rhein
- 1,616
- 3
- 23
- 47
1
vote
1 answer
How to export hclust cluster results
I'm new to R but I've been stuck on this issue for weeks now. I have a data set of 343 observations and 28 columns. The first of these 28 columns is an identifier. Before running my analysis, I omitted that ID column using newdata <- olddata[,2:28]…

1buzz
- 19
- 4