0
votes

How to do topic analysis from text file? i put this code, but I get the error below when i run the last line. Why it is making this error?

library(tm)
treex <- treex <- readLines(file.choose())
CorpusObj<- VectorSource(treex) 
breeze <- LDA(CorpusObj[1:200], control=list(alpha = 0.1), k=20)

Error in !all.equal(x$v, as.integer(x$v)) : invalid argument type

1

1 Answers

0
votes

You need CorpusObj[1:200, ]

breeze <- LDA(CorpusObj[1:200, ], control=list(alpha = 0.1), k=20)