wzmli / phyloglmm

GNU General Public License v3.0
4 stars 2 forks source link

Error in Matrix::rankMatrix(TMBStruc$data.tmb[[whichX]]) : length(d <- dim(x)) == 2 is not TRUE #13

Closed nicolaycunha closed 2 years ago

nicolaycunha commented 2 years ago

Hi again,

The package was running fine until I updated my R and related packages, thus I have been receiving the below error when running the same models that used to work fine before:

Error in Matrix::rankMatrix(TMBStruc$data.tmb[[whichX]]) : 
  length(d <- dim(x)) == 2 is not TRUE

I have already reinstalled the package glmmTMB by using remotes::install_github("glmmTMB/glmmTMB/glmmTMB"), but the error persists.

Perhaps any issue with matrix coercion within TMB?

Below is my sessionInfo()

R version 4.2.2 (2022-10-31)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Ventura 13.0.1

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] phyloglmm_0.1.0.9001 forcats_0.5.2        stringr_1.5.0        purrr_0.3.5          readr_2.1.3         
 [6] tibble_3.1.8         tidyverse_1.3.2      V.PhyloMaker_0.1.0   tidyr_1.2.1          scales_1.2.1        
[11] Rmisc_1.5.1          plyr_1.8.8           reshape2_1.4.4       readxl_1.4.1         picante_1.8.2       
[16] vegan_2.6-4          permute_0.9-7        phytools_1.2-0       maps_3.4.1           pbkrtest_0.5.1      
[21] nlme_3.1-160         MASS_7.3-58.1        lmerTest_3.1-3       lme4_1.1-31          lattice_0.20-45     
[26] glmmTMB_1.1.5.9000   ggplot2_3.4.0        geiger_2.0.10        dplyr_1.0.10         dendextend_1.16.0   
[31] coda_0.19-4          car_3.1-1            carData_3.0-5        brranching_0.7.0     broom_1.0.1         
[36] ape_5.6-2            Matrix_1.5-3  

Many thanks! Nicolay

bbolker commented 2 years ago

This is proximally due to the addition of rank-checking in glmmTMB. Reverting to an older version of glmmTMB could work around it, as could (possibly) adding control = glmmTMBControl(rank_check = "skip"), but I'm also looking at the plumbing some more ...

nicolaycunha commented 2 years ago

Thanks @bbolker, indeed reverting to the previous version of glmmTMB worked fine, but setting the control = glmmTMBControl(rank_check = "skip") in the latest version did not.

In any case, I can now run my models smoothly.

Cheers! Nicolay