DenisRustand / INLAjoint

Joint modeling multivariate longitudinal and time-to-event outcomes with INLA
16 stars 0 forks source link

inla.get.inlaEnv is not an exported object from 'namespace:INLA' #28

Closed hpcowley closed 5 months ago

hpcowley commented 5 months ago

I am attempting to specify a simple joint model of the following form:

IJ <- joint(
  formSurv = inla.surv(testsurv$time_since_dx_days, testsurv$death_status) ~ lastdrug,
  formLong = ca19_9 ~ time_since_dx_days * drug * dose + (1|cohort_id_f),
  dataLong = testlong,
  dataSurv = testsurv,
  id = "cohort_id_f",
  timeVar = "time_since_dx_days",
  basRisk="weibullsurv",
  family = "lognormal",
  assoc = "CV" 
)

When I do so, I receive the error: inla.get.inlaEnv is not an exported object from 'namespace:INLA'

> traceback()
2: assign("processed.status.for.model.scopy.in.section.latent", 
       TRUE, INLA::inla.get.inlaEnv())
1: joint(formSurv = inla.surv(testsurv$time_since_dx_days, testsurv$death_status) ~ 
       lastdrug, formLong = ca19_9 ~ time_since_dx_days * drug * 
       dose + (1 | cohort_id_f), dataLong = testlong, dataSurv = testsurv, 
       id = "cohort_id_f", timeVar = "time_since_dx_days", basRisk = "weibullsurv", 
       family = "lognormal", assoc = "CV")

I am using INLA 19.01.29 and INLAjoint 24.3.25.

Any help you can provide is much appreciated!

DenisRustand commented 5 months ago

The error is because your INLA vesrion is too old, we made changes in INLA that are required for INLAjoint. You can update INLA from R by running the following command if you are using Linux or MAC:

library(INLA)
inla.update(testing=T)

If you are using Windows, you can update with the following command in R: install.packages("INLA",repos=c(getOption("repos"),INLA="https://inla.r-inla-download.org/R/testing"), dep=TRUE) Also, in your call of the joint() function, you don't need to specify the dataset for the outcome in the inla.surv object, i.e., inla.surv(time_since_dx_days, death_status)

Best, Denis

hpcowley commented 5 months ago

Thank you so much for your quick help! I really appreciate it.