I have a model object which shows larger size in hard disk than in R. After some searching, I managed to get the problem cause as shown below
format(object.size(JMFit1$model_info$coxph_components$TermsU), units='Mb')
[1] "0 Mb"
pryr::object_size(JMFit1$model_info$coxph_components$TermsU)
28.5 MB
However JMFit1$model_info$coxph_components$TermsU
returns
>JMFit1$model_info$coxph_components$TermsU
...
attr(,".Environment")
<environment: 0x0000000025035540>
...
So, is there any way to access this environment using the reference id i.e. "0x0000000025035540" and then apply ls
for example to explore it.
Here are the questions I try Q1 and Q2, but without success. Also, I have tried ls(envir=attr(lm.fit.full$terms, ".Environment"))
from this blog but it through the following error
Error in ls(envir = attr(JMFit1$model_info$coxph_components$TermsU, ".Environment")) : invalid 'envir' argument
The full model:
library(JMbayes)
MixedModelFit1 <- mvglmer(list(log(serBilir) ~ year + (year | id)), data = pbc2, families = list(gaussian))
pbc2.id$Time <- pbc2.id$years
pbc2.id$event <- as.numeric(pbc2.id$status != "alive")
CoxFit <- coxph(Surv(Time, event) ~ drug + age, data = pbc2.id, model = TRUE)
JMFit1 <- mvJointModelBayes(MixedModelFit1, CoxFit, timeVar = "year")
Many thanks in advance for any suggestion or help.