require(cluster)
# The Ruspini data set from the package "cluster""
x = as.matrix(ruspini)
# assign random weights to observations
w = sample(1:10,nrow(x),replace = TRUE)
wss(x,w)
Run the code above in your browser using DataLab