error with sdmTMB_cv when going back to models that previously ran #275
-
I'm getting an error with sdmTMB_cv(): 'Error: object does not inherit from class sdmTMB' I was going back to some code from a few weeks ago that had no issues at the time and now it is throwing an error. I suspect this is due to package updates (similar to the error with s() - 'object of type 'symbol' is not subsettable' that I saw posted here and I had myself). I have tried installing the package from CRAN and from github with no success (this is what fixed the issue with using a smoother). In addition to my own code, I've tried the example code from the cross validation vignette (pasted below). Any ideas? Thanks so much! data(pcod) m_cv <- sdmTMB_cv( sanity(m_cv)
Matrix products: default locale: time zone: America/Los_Angeles attached base packages: other attached packages: loaded via a namespace (and not attached): |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I'm not sure what's happening. Your initial post had:
which is curious, because at least in sdmTMB Your Matrix package is one minor version behind: Do you get the same error with a non-cross-validation example? library(sdmTMB)
fit <- sdmTMB(
density ~ 1,
data = pcod_2011, spatial = "off",
family = tweedie(link = "log")
) Also, if the above doesn't work, can you try installing sdmTMB (and possibly TMB) from source? install.packages("TMB", type = "source")
install.packages("sdmTMB", type = "source") You'll need compilers installed first. If you don't have those, you can run Then, again, restart R, and try the example. |
Beta Was this translation helpful? Give feedback.
I'm not sure what's happening. Your initial post had:
which is curious, because at least in sdmTMB
as(, "dgTMatrix")
hasn't been used for a very long time.Your Matrix package is one minor version behind:
Matrix_1.6-1
vs.Matrix_1.6-1.1
and I know there was some breaking change in Matrix with respect to TMB recently. Can you try updating that, restarting your R session, and trying again?Do you get the same error with a non-cross-validation example?
Also, if the above doesn't work, can y…