Kmean algorithm in R using hamming distance