title: r - simpler code than this? -- rgraphviz plot
body: <p>I don't see a direct way to exclude non-connected terms from an Rgraphviz correlation plot.  I developed a convoluted way to remove the terms that won't be in the plot. (I'm new to r.)  Does Rgraphviz actually have this option, and/or is there less convoluted code to get the needed subset of terms?</p>
  
  <pre><code>terms1=findFreqTerms(dtm, lowfreq=30)
  # Find the subset of terms1 where every term in terms1 has a 
  # correlation of at least 0.7 with at least one other term in terms1, 
  # as they occur in the dtm.
  c1 = cor(as.matrix(dtm))
  c2 = c1[terms1,terms1]
  c2[c2 == 1] &lt;- NA 
  c2[abs(c2) &lt; 0.7] &lt;- NA 
  library(reshape)
  c2 &lt;- na.omit(melt(c2)) 
  c2 = as.data.frame.array(c2)
  c2 = unique(c2[,2])
  # Rgraphviz must be loaded.
  plot(dtm, terms=c2, corThreshold=0.7)
  </code></pre>
  
  <p>This code has a potential flaw - if two terms happen to have a correlation of 1.0.  The line is in there to remove a terms correlation with itself.</p>