title: Remove words that occur only once and with low IDF in R
body: <p>I have a dataframe with a column with some text in it. I want to do three data pre-processing steps: </p>
  
  <p>1) remove words that occur only once
  2) remove words with low inverse document frequency (IDF) and 3) remove words that occur most frequently</p>
  
  <p>This is an example of the data:</p>
  
  <pre><code>head(stormfront_data$stormfront_self_content)
  
  Output:
  
  [1] "        , ,    stormfront!  thread       members  post  introduction,     \".\"     stumbled   white networking site,    reading &amp; decided  register  account,      largest networking site     white brothers,  sisters!    read : : guidelines  posting - stormfront introduction  stormfront - stormfront  main board consists   forums,  -forums   : newslinks &amp; articles - stormfront ideology  philosophy - stormfront activism - stormfront       network   local level: local  regional - stormfront international - stormfront  ,  .  addition   main board   supply  social groups    utilized  networking.  final note:      steps    sustaining member,  core member      site online,   affords  additional online features. sf: shopping cart   stormfront!"
  [2] "bonjour      warm  brother !   forward  speaking     !"                                                                                                                      
  [3] " check   time  time   forums.      frequently    moved  columbia   distinctly  numbered.    groups  gatherings         "                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
  [4] "  !  site  pretty nice.    amount  news articles.  main concern   moment  islamification."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
  [5] " , discovered  site   weeks ago.  finally decided  join   found  article  wanted  share  .   proud   race   long time    idea  site    people  shared  views existed."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
  [6] "  white brothers,  names jay      member   years,        bit  info    ?    stormfront meet ups     ? stay strong guys    jay, uk"                                                                                                           
  
  </code></pre>
  
  <p>Any help would be greatly appreciated, as I am not too familiar with R.</p>