How to create a term-document matrix using both unigram and bigrams?

382 views
Skip to first unread message

Ockert Janse van Rensburg

unread,
Jan 2, 2013, 2:55:55 AM1/2/13
to rtextto...@googlegroups.com
Hi there, 

I was wondering whether there is a way in RTextTools, where I can create a term-document matrix which contain both 1-gram and 2-gram level terms.

I tried the following which didn't yield the desired outcome.

> create_matrix(db.sentences$sentence, ngramLength=c(1,2))

Warning message:
In if (ngramLength > 1) { :
  the condition has length > 1 and only the first element will be used

Any suggestions?

Thanks,

Timothy P. Jurka

unread,
Jan 2, 2013, 3:08:30 PM1/2/13
to rtextto...@googlegroups.com
Hi Ockert,

This functionality will be included in the next version of RTextTools, which I expect to release in mid-January.

Best,
Tim
Reply all
Reply to author
Forward
0 new messages