2

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

majesus
  • 303
  • 2
  • 9
  • Cannot reproduce with `sessionInfo()`: `R version 3.3.2 (2016-10-31) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Linux Mint 18 locale: [1] LC_CTYPE=fr_FR.UTF-8 LC_NUMERIC=C LC_TIME=fr_FR.UTF-8 LC_COLLATE=fr_FR.UTF-8 LC_MONETARY=fr_FR.UTF-8 [6] LC_MESSAGES=fr_FR.UTF-8 LC_PAPER=fr_FR.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=fr_FR.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] quanteda_0.9.9-17` – Aurèle Feb 03 '17 at 14:30
  • `loaded via a namespace (and not attached): [1] Matrix_1.2-7.1 tools_3.3.2 fastmatch_1.1-0 Rcpp_0.12.9 stringi_1.1.2 grid_3.3.2 data.table_1.10.0 [8] RcppParallel_4.3.20 lattice_0.20-34 ca_0.70` – Aurèle Feb 03 '17 at 14:31
  • 1
    Yes it seemed to be an issue with your version of the *Matrix* package. Always best to make sure your packages and R version are up to date. We need some of the newer functions in *Matrix* to make the sparse object handling work. – Ken Benoit Feb 03 '17 at 19:11
  • And in the future, this sort of qn is better for an issue on GitHub than SO. – Ken Benoit Feb 03 '17 at 19:12
  • Thanks for your kindness. Your response and advice have been helpful. In the future I will use the channel you suggest me, for my doubts about Quanteda. – majesus Feb 03 '17 at 19:39

1 Answers1

8

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")
Donald Duck
  • 8,409
  • 22
  • 75
  • 99
andres
  • 96
  • 1
  • 2
    Thanks for the speed in your answer. I installed Matrix, uninstalled Quanteda, I installed it again, and I restarted R. All great. – majesus Feb 03 '17 at 19:41