Running examples in 'riskRegression-Ex.R' failed
The error most likely occurred in:

> ### Name: IPA
> ### Title: Explained variation for settings with binary, survival and
> ###   competing risk outcome
> ### Aliases: IPA rsquared rsquared.default rsquared.glm rsquared.coxph
> ###   rsquared.CauseSpecificCox IPA.default IPA.glm IPA.coxph
> ###   IPA.CauseSpecificCox
> 
> ### ** Examples
> 
> library(prodlim)
> library(data.table)

Attaching package: 'data.table'

The following object is masked from 'package:base':

    %notin%

> # binary outcome
> library(lava)
> set.seed(18)
> learndat <- sampleData(48,outcome="binary")
> lr1 = glm(Y~X1+X2+X7+X9,data=learndat,family=binomial)
> IPA(lr1)
     Variable  Brier    IPA IPA.drop
       <fctr> <char> <char>   <char>
1: Null model   24.8    0.0     37.1
2: Full model   15.6   37.1      0.0
3:         X1   19.5   21.6     15.5
4:         X2   15.8   36.3      0.8
5:         X7   16.0   35.4      1.7
6:         X9   21.2   14.6     22.5

NOTE: Values are multiplied by 100 and given in %.
NOTE: The higher IPA the better.
NOTE: IPA.drop = IPA(Full model) - IPA. The higher the drop
the more important is the variable for the full model.
> 
> ## validation data
> valdat=sampleData(94,outcome="binary")
> IPA(lr1,newdata=valdat)
     Variable  Brier    IPA IPA.drop
       <fctr> <char> <char>   <char>
1: Null model   23.6    0.0     -1.3
2: Full model   23.9   -1.3      0.0
3:         X1   23.9   -0.9     -0.3
4:         X2   23.2    1.9     -3.1
5:         X7   24.0   -1.7      0.4
6:         X9   23.5    0.5     -1.8

NOTE: Values are multiplied by 100 and given in %.
NOTE: The higher IPA the better.
NOTE: IPA.drop = IPA(Full model) - IPA. The higher the drop
the more important is the variable for the full model.
> 
> ## predicted risks externally given
> p1=predictRisk(lr1,newdata=valdat)
> IPA(p1,formula=Y~1,valdat)
        model    IPA  Brier
       <fctr> <char> <char>
1: Null model    0.0   23.6
2:    numeric   -1.3   23.9

NOTE: Values are multiplied by 100 and given in %.
NOTE: The higher IPA the better.
NOTE: IPA.drop = IPA(Full model) - IPA. The higher the drop
the more important is the variable for the full model.
> 
> # survival
> library(survival)
> data(pbc)
> pbc=na.omit(pbc)
> pbctest=(1:NROW(pbc)) %in% sample(1:NROW(pbc),size=.632*NROW(pbc))
> pbclearn=pbc[pbctest,]
> cox1= coxph(Surv(time,status!=0)~age+sex+log(bili)+log(albumin)+log(protime),
+       data=pbclearn,x=TRUE)
> 
> ## same data
> IPA(cox1,formula=Surv(time,status!=0)~1,times=1000)
Error in `[.data.table`(score, , `:=`(IPA, 1 - Brier/Brier[model == "Null model"]),  : 
  attempt access index 3/3 in VECTOR_ELT
Calls: IPA ... computePerformance -> IPACompute -> [ -> [.data.table
Execution halted