Running ‘Reproduce-Fig-paper.R’ [17s/18s]
  Running ‘test-wally-function.R’
Running the tests in ‘tests/test-wally-function.R’ failed.
Complete output:
  > 
  > # {{{ load packages
  > library(survival)
  > library(data.table)
  > library(testthat)
  > library(prodlim)
  > library(riskRegression)
  riskRegression version 2023.12.21
  > library(wally)
  > # }}}
  > 
  > 
  > # {{{ "Wally for survival weird formula and hanging"
  > test_that("Wally for survival weird formula and hanging",{
  +     set.seed(10)
  +     d <- sampleData(138,outcome="survival")
  +     setnames(d,c("time","event"),c("truc","toto"))
  +     f <- coxph(Surv(truc,toto)~X6+X7,data=d,x=TRUE)
  +     d$pi <- predictRisk(f,times=2,newdata=d)
  +     pred <- as.matrix(d$pi,ncol=1)
  +     ## matrix input
  +     u <- wallyPlot(pred,
  +                    time=2,
  +                    formula=as.formula(paste("Hist(","truc",",","toto",")~1")),
  +                    data=d,
  +                    hanging=TRUE,
  +                    seed=5987,
  +                    colbox="red",
  +                    superuser.hide=FALSE,
  +                    superuser.choice=NULL,
  +                    q=13)
  +     ## model input
  +     v <- wallyPlot(f,
  +                    time=2,
  +                    formula=as.formula(paste("Hist(","truc",",","toto",")~1")),
  +                    data=d,
  +                    hanging=TRUE,
  +                    seed=5987,
  +                    colbox="red",
  +                    superuser.hide=FALSE,
  +                    superuser.choice=NULL,
  +                    q=13)
  +     expect_equal(u,v)
  + })
  ── Error: Wally for survival weird formula and hanging ─────────────────────────
  Error in `cbind(idxM, pidxM)`: cannot get data pointer of 'NULL' objects
  Backtrace:
       ▆
    1. └─riskRegression::sampleData(138, outcome = "survival")
    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