title: How can i get sum of squared errors(SSE) from k means algorithm?
body: <p>I Have a data frame with two columns and 450 rows. First I have to run a K-means algorithm with different k values(meaning k clusters). And for each time I run a different k value I have to calculate the SSE. I have just the mathematical equation given. SSE is calculated by squaring  each points distance to its respective clusters centroid and then summing everything up. So at the end I should have SSE for each k value. </p>
  
  <p>I have gotten to the place where you run the k means algorithm:</p>
  
  <pre><code>Data.kemans &lt;- kmeans(data, centers = 3)
  </code></pre>
  
  <p>How could I get the SSE (sum of squared errors) from this <code>data.kmeans</code> ?</p>