title: TermDocumentMatrix errors in R
body: <p>I have been working through numerous online examples of the {tm} package in R, attempting to create a TermDocumentMatrix.  Creating and cleaning a corpus has been pretty straightforward, but I consistently encounter an error when I attempt to create a matrix.  The error is: </p>
  
  <blockquote>
    <p>Error in UseMethod("meta", x) : 
      no applicable method for 'meta' applied to an object of class "character"
    In addition: Warning message:
    In mclapply(unname(content(x)), termFreq, control) :
      all scheduled cores encountered errors in user code</p>
  </blockquote>
  
  <p>For example, here is code from Jon Starkweather's text mining <a href="http://www.unt.edu/rss/class/Jon/Benchmarks/TextMining_L_JDS_Jan2014.pdf">example</a>.  Apologies in advance for such long code, but this does produce a reproducible example.  Please note that the error comes at the end with the {tdm} function.  </p>
  
  <pre><code>#Read in data
  policy.HTML.page &lt;- readLines("http://policy.unt.edu/policy/3-5")
  
  #Obtain text and remove mark-up
  policy.HTML.page[186:202]
  id.1 &lt;- 3 + which(policy.HTML.page == "                    TOTAL UNIVERSITY        &lt;/div&gt;")
  id.2 &lt;- id.1 + 5
  text.data &lt;- policy.HTML.page[id.1:id.2]
  td.1 &lt;- gsub(pattern = "&lt;p&gt;", replacement = "", x = text.data, 
       ignore.case = TRUE, perl = FALSE, fixed = FALSE, useBytes = FALSE)
  
  td.2 &lt;- gsub(pattern = "&lt;/p&gt;", replacement = "", x = td.1, ignore.case = TRUE,
       perl = FALSE, fixed = FALSE, useBytes = FALSE)
  
  text.d &lt;- td.2; rm(text.data, td.1, td.2)
  
  #Create corpus and clean 
  library(tm)
  library(SnowballC)
  txt &lt;- VectorSource(text.d); rm(text.d)
  txt.corpus &lt;- Corpus(txt)
  txt.corpus &lt;- tm_map(txt.corpus, tolower)
  txt.corpus &lt;- tm_map(txt.corpus, removeNumbers)
  txt.corpus &lt;- tm_map(txt.corpus, removePunctuation)
  txt.corpus &lt;- tm_map(txt.corpus, removeWords, stopwords("english"))
  txt.corpus &lt;- tm_map(txt.corpus, stripWhitespace); #inspect(docs[1])
  txt.corpus &lt;- tm_map(txt.corpus, stemDocument)
  
  # NOTE ERROR WHEN CREATING TDM
  tdm &lt;- TermDocumentMatrix(txt.corpus)
  </code></pre>