#!/usr/bin/Rscript e <- c(1.5, 3, 4, 5.1, 6) d <- dist(e) h <- hclust(d, "single") par(mfrow=c(1,2)) plot(h) plot(e, rep(0, length(e))) text(e, 0.1, 1:5)