张伦
2014-Jun-25 02:43 UTC
[R] Assigning document id to each document containing in the Document Term Matrix (R Package "tm")
Dear All, When I do "DocumentTermMatrix" analysis, can I assign a document id to the document (i.e., the row in the attached matrix marked in red)? Here is my code: tdm=DocumentTermMatrix(corpus,control) inspect (tdm2[5:20,9:14]) Terms Docs 002089 002223 002236 002268 002415 002439 5 0 0 0 0 0 0 6 0 0 0 0 0 0 7 0 0 0 0 0 0 8 0 0 0 0 0 0 9 0 0 0 0 0 0 10 0 0 0 0 0 0 11 0 0 0 0 0 0 12 0 0 0 0 0 0 13 0 0 0 0 0 0 14 0 0 0 0 0 0 15 0 0 0 0 0 0 16 0 0 0 0 0 0 17 0 0 0 0 0 0 18 0 0 0 0 0 0 19 0 0 0 0 0 0 20 0 0 0 0 0 0 [[alternative HTML version deleted]]