Skeleton k-means functions in R.