Hi: I want to calculate how much the values in a binary matrix varies, and for that I apply the sd() method. mat <- matrix(c(1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1), nrow=4, ncol=3) stddev <- sd(dist(mat, method="binary")) And i get the following answer: stddev [1] 0.3442652 Is this correct? Or there is a better way out? Bests: John