Running ‘test-glmSeries.R’
  Running ‘test-publish-gls.R’
  Running ‘test-publish-mi.R’
  Running ‘test-publish.R’
  Running ‘test-regressionTable.R’
  Running ‘test-univariateTable.R’
Running the tests in ‘tests/test-publish-mi.R’ failed.
Complete output:
  > library(testthat)
  > library(Publish)
  Loading required package: prodlim
  > library(mitools)
  > library(smcfcs)
  > library(riskRegression)
  riskRegression version 2023.12.21
  > 
  > test_that("multiple imputation",{
  +     set.seed(71)
  +     d=sampleData(100)
  +     ## generate missing values
  +     d[X1==1,X6:=NA]
  +     d[X2==1,X3:=NA]
  +     d=d[,.(X8,X4,X3,X6,X7)]
  +     sapply(d,function(x)sum(is.na(x)))
  +     d[,X4:=factor(X4,levels=c("0","1"),labels=c("0","1"))]
  +     set.seed(17)
  +     f= smcfcs(d,smtype="lm",smformula=X8~X4*X3+X6+X7,method=c("","","logreg","norm",""),m=3)
  +     ccfit=lm(X8~X4*X3+X6+X7,data=d)
  +     impobj <- imputationList(f$impDatasets)
  +     models <- with(impobj,lm(X8~X4*X3+X6+X7))
  +     mifit <- MIcombine(models)
  +     a <- publish(mifit,fit=ccfit,data=d)
  + })
  ── Error: multiple imputation ──────────────────────────────────────────────────
  Error in `cbind(idxM, pidxM)`: cannot get data pointer of 'NULL' objects
  Backtrace:
       ▆
    1. └─riskRegression::sampleData(100)
    2.   ├─lava::`distribution<-`(...)
    3.   └─lava:::`distribution<-.lvm`(...)
    4.     ├─lava::`addvar<-`(`*tmp*`, value = as.formula(paste("~", variable)))
    5.     └─lava:::`addvar<-.lvm`(...)
    6.       ├─lava::`regression<-`(`*tmp*`, ..., value = value)
    7.       └─lava:::`regression<-.lvm`(`*tmp*`, ..., value = value)
    8.         └─lava::procformula(object, value, ...)
    9.           ├─lava::`exogenous<-`(...)
   10.           └─lava:::`exogenous<-.lvm`(...)
   11.             └─lava::reindex(x)
   12.               └─lava:::mat.lvm(x, res)
   13.                 └─base::cbind(idxM, pidxM)
  
  Error:
  ! Test failed
  Backtrace:
      ▆
   1. ├─testthat::test_that(...)
   2. │ └─withr (local) `<fn>`()
   3. └─reporter$stop_if_needed()
   4.   └─rlang::abort("Test failed", call = NULL)
  Execution halted