%load_ext rmagic %%R library(vegan) %%R spmat<-read.csv("http://epi.whoi.edu/ipython/results/mdistefano/pg_site1_sp.csv",header=T) %%R print(head(spmat)) %%R dd <- na.omit(spmat) dd1 <- dd[3:6] print(head(dd1)) %%R distmat1<-vegdist(dd1) %%R clusa1<-hclust(distmat1,"average") %%R print(clusa1) %%R print(dend1 <- as.dendrogram(clusa1)) %%R plot(dend1) %%R dend12 <- cut(dend1, h=0.06) plot(dend12$upper) plot(dend12$lower[[1]]) lines = !jist -p hclust.ipynb print lines[0].replace("https://gist.github.com", "http://nbviewer.ipython.org")