One method for including the names of your samples in a dendrogram generated using the hclust package in R is to use the labels parameter in the plot() function.
First, you need to generate the dendrogram using the hclust() function, saving the result to a variable (e.g. "hc"). Then, you can use the plot() function to create the dendrogram and include the labels.
For example:
# Generate dendrogram using hclust
hc <- hclust(dist(mydata))
# Plot dendrogram with labels
plot(hc, main="My Dendrogram", xlab="Samples", sub="", labels=row.names(mydata))
In this example, we are using the row names of the "mydata" matrix as the labels for the samples. You can customize the title and axis labels as desired.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2021-11-03 11:00:00 +0000
Seen: 10 times
Last updated: Aug 20 '21
What is the method to obtain the names of the columns through DBD::CSV?
If there are empty subfolders with identical names, can they be deleted?
How can I modify several column names within a single migration using Laravel 5.0?
How can nested stack navigator permit the use of the same screen names and cycle?
How can S4 Class be vectorized in R?
How can one ensure the container names remain uniform when using docker?