## 3 clusters (1 = connected)
x <- matrix(c(1,1,0,0,0,0,
1,1,0,0,0,0,
0,0,1,1,0,0,
0,0,1,1,0,0,
0,0,0,0,1,1,
0,0,0,0,1,1), ncol=6)
c <- cluster.dist(as.dist(!x), beta = 0) # invert and note that 0 >= 0
c
Run the code above in your browser using DataLab