Skip to content

Instantly share code, notes, and snippets.

@taroyabuki
Created February 11, 2013 13:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taroyabuki/4754300 to your computer and use it in GitHub Desktop.
Save taroyabuki/4754300 to your computer and use it in GitHub Desktop.
samples <- data.frame(
x = c(3, 7, 10),
y = c(7, 1, 8),
row.names = c("A", "B", "C"))
plot(samples, type = "n")
text(samples[,1], samples[,2], row.names(samples))
d <- dist(samples)
cl <- hclust(d, method = "centroid")
plot(cl, hang = -1)
cl <- hclust(d, method = "median")
plot(cl, hang = -1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment