afex icon indicating copy to clipboard operation
afex copied to clipboard

glmmTMB updates break some things

Open mebrooks opened this issue 1 year ago • 5 comments

Hi, we did some fairly large updates to glmmTMB recently, so I'm checking all the reverse dependencies. I got this output from afex

  • checking running R code from vignettes ...
      ‘afex_analysing_accuracy_data.Rmd’ using ‘UTF-8’... OK
      ‘afex_anova_example.Rmd’ using ‘UTF-8’... OK
      ‘afex_mixed_example.Rmd’ using ‘UTF-8’... OK
      ‘afex_plot_introduction.Rmd’ using ‘UTF-8’... OK
      ‘afex_plot_supported_models.Rmd’ using ‘UTF-8’... failed
      ‘assumptions_of_ANOVAs.Rmd’ using ‘UTF-8’... OK
      ‘introduction-mixed-models.pdf.asis’ using ‘UTF-8’... OK
     ERROR
    Errors in running code in vignettes:
    when running code in ‘afex_plot_supported_models.Rmd’
    ...
    
    > plot_grid(afex_plot(tmb, "spp"), afex_plot(tmb, "spp", 
    +     data_geom = geom_violin), afex_plot(tmb, "spp", id = "site", 
    +     data = Salamanders .... [TRUNCATED] 
    dv column detected: count
    No id column passed. Assuming all rows are independent samples.
    
      When sourcing ‘afex_plot_supported_models.R’:
    Error: missing value where TRUE/FALSE needed
    Execution halted
    

mebrooks avatar Jun 04 '24 10:06 mebrooks

I poked around with this a little bit, and it seems that it would be sufficient to run up2date() on the stored glmmTMB object (or, alternately, to rebuild the stored .rda file with the devel version of glmmTMB).

library(glmmTMB)
library(afex)
library(ggplot2)

load(system.file("extdata/", "tmb_example_fit.rda", package = "afex"))
try(afex_plot(tmb, "spp")) ## error
tmb <- up2date(tmb)
afex_plot(tmb, "spp") ## works

## full example
cowplot::plot_grid(
  afex_plot(tmb, "spp"),
  afex_plot(tmb, "spp", data_geom = geom_violin),
  afex_plot(tmb, "spp", id = "site", data = Salamanders), 
  labels = "AUTO", nrow = 1
)

bbolker avatar Jun 20 '24 17:06 bbolker

I have now updated the files. However, they only work with the new version of glmmTMB and not with the current CRAN version (according to my checks). So once you upload to CRAN, I can then push my new version as well. Unless tyou have another suggestion.

singmann avatar Jun 26 '24 10:06 singmann

I think we're in less of a rush to submit a new version to CRAN than we thought we were (see the tail end of this issue).

Instead of updating stored files and making them potential backward-incompatible with older glmmTMB versions, in principle it should be possible by using up2date() when you read in stored versions of fitted models from older glmmTMB versions, as we do with our gt_load utility (although this has certainly not been exhaustively tested).

In any case, good to know that this on track for whenever we do end up submitting the new version. Thanks.

bbolker avatar Jun 26 '24 20:06 bbolker

I have now essentially reverted to the previous glmmTMB model object (i.e., one created through the current CRAN version) and added a call to up2date() when loading (I also tried gt_load() but that somehow didn't work).

Thus, according to my checks, it should now work with both glmmTMB versions, current CRAN and development from GitHub. The release candidate is development\afex_1.4-1.tar.gz. If you have the time, maybe you can check as well against the development version, otherwise I will just push to CRAN.

singmann avatar Jun 28 '24 13:06 singmann

:tada: Passes R CMD check here with development version of glmmTMB.

bbolker avatar Jun 28 '24 13:06 bbolker

Sorry for the insanely long delay (there was a weird issue with rmarkdown I couldn't solve until now), but this version is on CRAN now.

singmann avatar Sep 01 '24 18:09 singmann

I don't understand why, but I'm still seeing this error when I do automated reverse dependenciy checks. Alternatively, I installed afex from CRAN and was able to knit the Rmd file just fine on my computer. So I guess this is a false positive, right?

P.S. It looks like up2date is used in the CRAN version.

mebrooks avatar Sep 23 '24 12:09 mebrooks

Hmm, I also cannot explain this as it should be using up2date(). Can it be an old afex version still in the checking pipeline?

singmann avatar Sep 23 '24 12:09 singmann

Yes, it is an old version (1.3-1)! I don't know why revdepcheck would do that. Sorry for wasting your time.

mebrooks avatar Sep 23 '24 12:09 mebrooks

No worries!

singmann avatar Sep 23 '24 13:09 singmann