I am working on dendrogram
plot(clust.res, hang=-1, main=dedro,labels=data1$Name.of.the.variety)
Then message that I get are:
Warning messages:
"labels" is not a graphical parameter
I am working on dendrogram
plot(clust.res, hang=-1, main=dedro,labels=data1$Name.of.the.variety)
Then message that I get are:
Warning messages:
"labels" is not a graphical parameter
That makes sense.
In general, the plot.dendrogram
function does not have a labels
parameter, and does not allow you to modify the labels of the dendrogram it plots.
It is, however, possible to do using the dendextend R package.
Here is a simple example for you to go through:
# some data and create the dendrogram
DATA <- 1:4
hc <- hclust(dist(DATA))
dend <- as.dendrogram(hc)
# Get dendextend for editing the labels
if(!require(dendextend)) install.packages("dendextend")
library(dendextend)
# Copy the object, and edit its labels
dend2 <- dend
labels(dend2) <- c("one", "two", "3", "four")
# compare the two dendrograms:
par(mfrow = c(1,2))
plot(dend, main = "original dend")
plot(dend2, main = "dend with edited labels")
The dendextend package also allows you to modify the labels color and size, see here for examples.