!head /Users/epi/pg_site1.csv %load_ext rmagic %%R library(vegan) %%R mat<-read.csv("http://epi.whoi.edu/ipython/results/mdistefano/pg_site1.csv",header=T) %%R dd <- mat[!is.na(mat$idcode) & !is.na(mat$temp) & !is.na(mat$sal) & !is.na(mat$count) & !is.na(mat$count) & !is.na(mat$subs),] %%R distmat<-vegdist(dd) %%R clusa<-hclust(distmat,"average") %%R print(clusa) %%R print(dend1 <- as.dendrogram(clusa)) %%R plot(dend1) %%R dend2 <- cut(dend1, h=0.07) plot(dend2$upper) plot(dend2$lower[[1]]) lines = !jist -p hclust.ipynb print lines[0].replace("https://gist.github.com", "http://nbviewer.ipython.org")