title: Converting a Document Term Matrix into a Matrix with lots of data causes overflow
body: <p>Let's do some Text Mining</p>
  
  <p>Here I stand with a document term matrix (from the <code>tm</code> Package)</p>
  
  <pre><code>dtm &lt;- TermDocumentMatrix(
       myCorpus,
       control = list(
           weight = weightTfIdf,
           tolower=TRUE,
           removeNumbers = TRUE,
           minWordLength = 2,
           removePunctuation = TRUE,
           stopwords=stopwords("german")
        ))
  </code></pre>
  
  <p>When I do a </p>
  
  <pre><code>typeof(dtm)
  </code></pre>
  
  <p>I see that it is a  "list" and the structure looks like</p>
  
  <pre><code>Docs
  Terms        1 2 ...
    lorem      0 0 ...
    ipsum      0 0 ...
    ...        .......
  </code></pre>
  
  <p>So I try a </p>
  
  <pre><code>wordMatrix = as.data.frame( t(as.matrix(  dtm )) ) 
  </code></pre>
  
  <p>That works for 1000 Documents.</p>
  
  <p>But when I try to use 40000 it doesn't anymore. </p>
  
  <p>I get this error:</p>
  
  <pre><code>Fehler in vector(typeof(x$v), nr * nc) : Vektorgröße kann nicht NA sein
  Zusätzlich: Warnmeldung:
  In nr * nc : NAs durch Ganzzahlüberlauf erzeugt
  </code></pre>
  
  <p><strong>Error in vector ... : Vector can't be NA
  Additional:
  In nr * nc NAs created by integer overflow</strong></p>
  
  <p>So I looked at as.matrix and it turns out that somehow the function converts it to a vector with as.vector and than to a matrix. 
  The convertion to a vector works but not the one from the vector to the matrix dosen't.</p>
  
  <p>Do you have any suggestions what could be the problem? </p>
  
  <p>Thanks, The Captain</p>