title: stemDocument R text mining
body: <p>My data is a txt file and looks as follows:<br>
  words number_doc<br>
  overwiew 1<br>
  client 1<br>
  store 1<br>
  marge 1<br>
  price 2<br>
  stock 2<br>
  economics 2</p>
  
  <p>The numbers of the documents are sorted (from the smallest to the largest). Now I want for each document all the words that belongs to the document. Now they stand in a column, but I want al the words in a textDocument (from the package tm, because it is neccesary for some functions in that package). I did this as follows: </p>
  
  <pre><code> data &lt;- read.table("poging.txt", header = TRUE)
   data
  
   doc &lt;- c()
   #I paste all the words from a document together:
   doc[1] &lt;- paste(data[1:4,1], collapse = ' ')
   doc[2] &lt;- paste(data[1:4,1], collapse = ' ')
  
   #Make a data.frame of it
   doc_df &lt;- data.frame(docs = doc, row.names = 1:2)
  
   #Install package
   install.packages("tm")
   library(tm)
  
   #Make a Dataframesource of it so that each row is seen as a document
   ds &lt;- DataframeSource(doc_df)
   inspect(VCorpus(ds))
  
   #Now I want to stem for example document number 1
   stemDocument(ds[[1]])
  </code></pre>
  
  <p>But by using <code>ds[[1]]</code> as argument, it doesn't work. He can't find document number 1.
  Can someone help me?</p>
  
  <p>In the examples om the package <code>tm</code> they use the data <code>crude</code>. I want that my data is the same format as that from <code>crude</code>.</p>
  
  <p>Silke</p>