Update centroids.R

Weighted variance formula updated to available R script (https://stat.ethz.ch/pipermail/r-help/2008-July/168762.html), however this is even larger than before