After a considerable search in the help documentation for ?dendrogram I came across a dendrapply function that contains an example to make something very similar. Here is your solution based on modifying the example in ?dendrapply :
Create a dendrogram and cut the height h=20 :
dhc <- as.dendrogram(hc <- hclust(dist(USArrests), "ave")) chc <- cut(dhc, h=20)$upper
Define a vector with new labels and the newLab function, which modifies the individual label node. Then pass this to dendrapply :
newLabels <- paste("Custom", 1:22, sep="_") local({ newLab <<- function(n) { if(is.leaf(n)) { a <- attributes(n) i <<- i+1 attr(n, "label") <- newLabels[i] } n } i <- 0 }) nhc <- dendrapply(chc, newLab) labels(nhc) [1] "Custom_1" "Custom_2" "Custom_3" "Custom_4" "Custom_5" "Custom_6" [7] "Custom_7" "Custom_8" "Custom_9" "Custom_10" "Custom_11" "Custom_12" [13] "Custom_13" "Custom_14" "Custom_15" "Custom_16" "Custom_17" "Custom_18" [19] "Custom_19" "Custom_20" "Custom_21" "Custom_22" plot(nhc)

source share