Error while using create_corpus function

132 views
Skip to first unread message

Shankar Jha

unread,
Dec 14, 2012, 7:23:46 AM12/14/12
to rtextto...@googlegroups.com
Hi Tim,
I am getting an error while i am using create_corpus function.

weighting <- weightTfIdf

create_matrix(corpus,language="english",
                              minWordLength = 3,minDocFreq = 1,ngramLength = 0,
                              removeNumbers = TRUE,stemWords = TRUE,
                              removePunctuation = TRUE,stripWhitespace = TRUE,
                              toLower = TRUE,removeStopwords = TRUE,
                              weighting,removeSparseTerms = .998,originalMatrix = matrix)

create_corpus(matrix_new,label,testSize=1:data_size,virgin=TRUE)

It's giving  "ra has too few, or too many elements matrix.csr"

Can you please help in the matter ?


Timothy P. Jurka

unread,
Dec 14, 2012, 12:48:37 PM12/14/12
to rtextto...@googlegroups.com
Hi Shankar,

It looks like you're using an old version of RTextTools because the "create_corpus" function no longer exists and has been replaced by the "create_container" version. Please try with the newest version first.

Best,
Tim

--
Timothy P. Jurka
Ph.D. Student
Department of Political Science
University of California, Davis
www.timjurka.com

Shankar Jha

unread,
Dec 18, 2012, 1:44:50 PM12/18/12
to rtextto...@googlegroups.com
yes tim, I was using the older version and create_corpus with the same. Actually it works in most of the cases. Anyways I have updated the library and replaced create_corpus wwith create_container but still it's not working.

Thanks,
Shankar Jha

Timothy P. Jurka

unread,
Dec 18, 2012, 2:27:31 PM12/18/12
to rtextto...@googlegroups.com
Hi Shankar,

Without seeing your data, I won't be able to tell you exactly what is wrong. However, it seems there are missing elements in your data. That is what the error is indicating.

Best,
Tim

--
Timothy P. Jurka
Ph.D. Student
Department of Political Science
University of California, Davis
www.timjurka.com

Reply all
Reply to author
Forward
0 new messages