title: Adding labels to a K-means cluster plot in R
body: <p>I have used some R code I found online to make a K-Means cluster plot, as follows: </p>
  
  <pre><code>dtmr &lt;-DocumentTermMatrix(docs,control=list(wordLengths=c(4,15), bounds = list(global = c(50,500))))
  ## do tfxidf
  dtm_tfxidf &lt;- weightTfIdf(dtmr)
  
  ### k-means (this uses euclidean distance)
  m &lt;- as.matrix(dtm_tfxidf)
  rownames(m) &lt;- 1:nrow(m)
  
  ### don't forget to normalize the vectors so Euclidean makes sense
  norm_eucl &lt;- function(m) m/apply(m, MARGIN=1, FUN=function(x) sum(x^2)^.5)
  m_norm &lt;- norm_eucl(m)
  
  
  ### cluster into 5 clusters
  cl &lt;- kmeans(m_norm, 5)
  
  table(cl$cluster)
  
  ### show clusters using the first 2 principal components
  plot(prcomp(m_norm)$x, col=cl$cl, text(m_norm, mpg, row.names(m)))
  </code></pre>
  
  <p>This does give me  plot of the 5 clusters, I amjust wondering how can I add labels to show what each dot is? </p>
  
  <p>And on a side note, is there anyway that I can see what these clusters are? The <code>table(cl$cluster)</code> line just prints five numbers, I do not know what these numbers mean, my data that I am using is just over 400 text documents.</p>