[R] term lists with tm package

Jack Tanner ihok at hotmail.com
Wed Aug 31 03:00:14 CEST 2011


I've got a sparse term list of the form

term1 doc1
term2 doc1
term3 doc2
etc.

I'd like to load this into a Corpus, as defined in the tm package. I was
thinking that one way to do this is to iterate over the list building up the i,
j, v vectors for a simple_triplet_matrix, and then to use that as an input to
as.TermDocumentMatrix.

Is that the best way to go? Any hints? Thanks in advance.



More information about the R-help mailing list