Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Warning in every model of glmmTMB 'giveCsparse'

I am using the glmmTMB library to run mixed models, within a R markdown document. Any model that I run, I get these warnings:

'giveCsparse' has been deprecated; setting 'repr = "T"' for you'giveCsparse' has been deprecated; setting 'repr = "T"' for you'giveCsparse' has been deprecated; setting 'repr = "T"' for you

Then, if I run the code in the console, I get these warnings:

Warning messages:
1: In Matrix::sparseMatrix(dims = c(0, 0), i = integer(0), j = integer(0),  :
  'giveCsparse' has been deprecated; setting 'repr = "T"' for you
2: In Matrix::sparseMatrix(dims = c(0, 0), i = integer(0), j = integer(0),  :
  'giveCsparse' has been deprecated; setting 'repr = "T"' for you
3: In Matrix::sparseMatrix(dims = c(0, 0), i = integer(0), j = integer(0),  :
  'giveCsparse' has been deprecated; setting 'repr = "T"' for you

My code looks like this:

m1 <- glmmTMB(count~var1+var2+var3+(1|group), data = bd, family = "poisson")

I tried reinstalling TMB and glmmTMB with dependencies=TRUE, but the message keeps appearing. Apparently it doesn't affect the model at all, but whatever tests or graphs I do, I keep getting warnings. Is it possible to fix this? Or do I just ignore it?

like image 544
MKie45 Avatar asked Apr 11 '21 00:04

MKie45


1 Answers

It's harmless. You can:

  1. Install the latest version of glmmTMB (1.1.2 at present) from CRAN.
  2. ignore it
  3. use suppressWarnings() (at the possible cost of missing other relevant warnings!)
  4. install the development version from GitHub, where it was fixed in this commit. (The binary packages on the repository have also been updated now.)

or you could downgrade your version of Matrix to an older version (using remotes::install_version() or the snapshot package)

like image 172
Ben Bolker Avatar answered Sep 28 '22 01:09

Ben Bolker