pbs-assess / sdmTMB

:earth_americas: An R package for spatial and spatiotemporal GLMMs with TMB
https://pbs-assess.github.io/sdmTMB/
187 stars 27 forks source link

`Error when reading the variable: 'proj_mesh'` with TMB 1.9.1 #112

Closed seananderson closed 2 years ago

seananderson commented 2 years ago
library(sdmTMB)
mesh <- make_mesh(pcod_2011, c("X", "Y"), cutoff = 20)
fit <- sdmTMB(
  density ~ s(depth),
  data = pcod_2011, mesh = mesh,
  family = tweedie(link = "log")
)

Results in the following with TMB 1.9.1 (released 2 days ago)

Error in getParameterOrder(data, parameters, new.env(), DLL = DLL) : 
  Error when reading the variable: 'proj_mesh'. Please check data and parameters.
In addition: Warning message:
In getParameterOrder(data, parameters, new.env(), DLL = DLL) :

 Error in getParameterOrder(data, parameters, new.env(), DLL = DLL) : 
Error when reading the variable: 'proj_mesh'. Please check data and parameters.

Helpfully reported by Kaitlyn O'Brien.

seananderson commented 2 years ago

Looks like this TMB commit from 3 days ago caused the issue when sparse matrix class conversion was changed in preparation for changes in the Matrix package.

Should be fixed now in the main branch.