# NOT RUN {
data(BCI)
dis <- vegdist(BCI)
ord <- isomap(dis, k = 3)
df <- fortify(ord, data = data.frame(Richness = specnumber(BCI)))
net <- fortify(ord, what = "network", axes = 1:2)
ggplot(df, aes(x = Dim1, y = Dim2)) +
geom_segment(data = net,
aes(x = xfrom, y = yfrom,
xend = xto, yend = yto),
colour = "grey85", size = 0.8) +
geom_point(aes(size = Richness)) +
coord_fixed()
# }
Run the code above in your browser using DataLab