-1
40種類のテキストのコーパスの文書用語行列(dtm)を作成しようとしています。私は20文字以上の単語を含まないようにしています。これどうやってするの?文書用語Matric(dtm) - R
40種類のテキストのコーパスの文書用語行列(dtm)を作成しようとしています。私は20文字以上の単語を含まないようにしています。これどうやってするの?文書用語Matric(dtm) - R
あなたがコントロール引数としてwordLenghts
を渡してみてください:
library(tm)
DocumentTermMatrix(corpus,control=list(wordLengths=c(1,20)))
ドキュメントから:
wordLenghts - An integer vector of length 2. Words shorter than the minimum word length wordLengths[1] or longer than the maximum word length wordLengths[2] are discarded. Defaults to c(3, Inf), i.e., a minimum word length of 3 characters.