QUANTEDA - invalid class “dfmSparse” object

2019-05-25 02:31发布

问题:

I get this warning-message. I use these data:

https://github.com/kbenoit/quanteda/tree/master/data/data_char_inaugural.RData

RStudio version: Version 1.0.136 – © 2009-2016 RStudio, Inc.

 library(quanteda)
 uk2010immigCorpus <- corpus(data_char_ukimmig2010, docvars = data.frame(party = names(data_char_ukimmig2010)),metacorpus = list(notes = "Immigration-related sections of 2010 UK party manifestos"))
 mydfm <- dfm(uk2010immigCorpus, remove = c("will", stopwords("english")),removePunct = TRUE)


 Error in validObject(.Object) : invalid class “dfmSparse” object: superclass "replValueSp" not defined in the environment of the object's class

What's wrong with QUANTEDA?

Thanks! majesus

回答1:

I solved the problem by installing Matrix library and then reinstalling quanteda, finally I reboot R and now dfm works.

install.packages("Matrix")
install.packages("quanteda")


标签: r quanteda