[R] Help with cleaning a corpus

vintersorg123 pablo.loyola.h at gmail.com
Mon Apr 18 16:00:56 CEST 2011


I created a corpus and I started to clean through this piece of code:

txt <-tm_map(txt,removeWords, stopwords("spanish"))
txt <-tm_map(txt,stripWhitespace)
txt <-tm_map(txt,tolower)
txt <-tm_map(txt,removeNumbers)
txt <-tm_map(txt,removePunctuation)

But something happpended: some of the documents  in the corpus became empty,
this is a problem when i try to make a document term matrix with tfidf. 
Is there any way to eliminate  automatically a document if it become empty? 

Or manually, how could i get the lenght of every document?

hope you can help me! thanks a lot


View this message in context: http://r.789695.n4.nabble.com/Help-with-cleaning-a-corpus-tp3457649p3457649.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list