title: How to calculate BIC for k-means clustering in R
body: <p>I've been using k-means to cluster my data in R but I'd like to be able to assess the fit vs. model complexity of my clustering using Baysiean Information Criterion (BIC) and AIC. Currently the code I've been using in R is:</p>
  
  <pre><code>KClData &lt;- kmeans(Data, centers=2, nstart= 100)
  </code></pre>
  
  <p>But I'd like to be able to extract the BIC and Log Likelihood. Any help would be greatly appreciated!</p>