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

> ### Name: cutpoints
> ### Title: Obtaining the cutpoints and / or regroupments of a
> ###   discretization.
> ### Aliases: cutpoints cutpoints,glmdisc-method
> 
> ### ** Examples
> 
> # Simulation of a discretized logit model
> set.seed(1)
> x = matrix(runif(300), nrow = 100, ncol = 3)
> cuts = seq(0,1,length.out= 4)
> xd = apply(x,2, function(col) as.numeric(cut(col,cuts)))
> theta = t(matrix(c(0,0,0,2,2,2,-2,-2,-2),ncol=3,nrow=3))
> log_odd = rowSums(t(sapply(seq_along(xd[,1]), function(row_id) sapply(seq_along(xd[row_id,]),
+ function(element) theta[xd[row_id,element],element]))))
> y = rbinom(100,1,1/(1+exp(-log_odd)))
> 
> sem_disc <- glmdisc(x,y,iter=50,m_start=4,test=FALSE,validation=FALSE,criterion="aic")
Current interaction being tested is between variables  and  with a probability of acceptance of 8.60794054684477e+22
Iteration 1 ended with a performance of aic = -Inf
Current interaction being tested is between variables  and  with a probability of acceptance of 454070997000659
Iteration 2 ended with a performance of aic = -146.627387885044
Current interaction being tested is between variables  and  with a probability of acceptance of 200527188631.801
Iteration 3 ended with a performance of aic = -134.688398422973
Current interaction being tested is between variables  and  with a probability of acceptance of 3.93293408835387e-13
Iteration 4 ended with a performance of aic = -141.01891639487
Current interaction being tested is between variables  and  with a probability of acceptance of 1.21137373117457e-09
Iteration 5 ended with a performance of aic = -144.090241747829
Current interaction being tested is between variables  and  with a probability of acceptance of 2.90180781766322e-09
Iteration 6 ended with a performance of aic = -147.736584880779
Current interaction being tested is between variables  and  with a probability of acceptance of 4.2659860287826e-13
Iteration 7 ended with a performance of aic = -145.968696629394
Current interaction being tested is between variables  and  with a probability of acceptance of 5.99584277733933e-09
Iteration 8 ended with a performance of aic = -145.405127716986
Current interaction being tested is between variables  and  with a probability of acceptance of 0.0790818417476765
Iteration 9 ended with a performance of aic = -135.657649584341
Current interaction being tested is between variables  and  with a probability of acceptance of 9117240068090224640
Iteration 10 ended with a performance of aic = -149.972648178222
Current interaction being tested is between variables  and  with a probability of acceptance of 3.73507671985548e-14
Iteration 11 ended with a performance of aic = -130.389877503509
Current interaction being tested is between variables  and  with a probability of acceptance of 1.65731719479607e-13
Iteration 12 ended with a performance of aic = -129.401929987841
Current interaction being tested is between variables  and  with a probability of acceptance of 6.30055156960411e-14
Iteration 13 ended with a performance of aic = -119.293975211212
Current interaction being tested is between variables  and  with a probability of acceptance of 7.90816668829935e-18
Iteration 14 ended with a performance of aic = -118.608978610338
Current interaction being tested is between variables  and  with a probability of acceptance of 7.04538649435418e-16
Iteration 15 ended with a performance of aic = -120.062204882864
Current interaction being tested is between variables  and  with a probability of acceptance of 1.43329500119444e-16
Iteration 16 ended with a performance of aic = -121.759994724648
Current interaction being tested is between variables  and  with a probability of acceptance of 2.70097428039769e-14
Iteration 17 ended with a performance of aic = -119.685767272139
Current interaction being tested is between variables  and  with a probability of acceptance of 8.68267256259722e-25
Iteration 18 ended with a performance of aic = -111.785429968211
Current interaction being tested is between variables  and  with a probability of acceptance of 7.25454808066789e-13
Iteration 19 ended with a performance of aic = -113.376192838099
Current interaction being tested is between variables  and  with a probability of acceptance of 1.07303948800604e-13
Iteration 20 ended with a performance of aic = -108.339396692983
Current interaction being tested is between variables  and  with a probability of acceptance of 7.90819255708027e-18
Iteration 21 ended with a performance of aic = -107.565040675666
Current interaction being tested is between variables  and  with a probability of acceptance of 7.90818065354395e-20
Iteration 22 ended with a performance of aic = -107.73996285071
Current interaction being tested is between variables  and  with a probability of acceptance of 2.70552293369441e-18
Iteration 23 ended with a performance of aic = -102.969451533429
Current interaction being tested is between variables  and  with a probability of acceptance of 1.66362040497571e-18
Iteration 24 ended with a performance of aic = -116.185628115003
Current interaction being tested is between variables  and  with a probability of acceptance of 3.67899768447046e-19
Iteration 25 ended with a performance of aic = -120.435363749134
Current interaction being tested is between variables  and  with a probability of acceptance of 4.95146984247928e-18
Iteration 26 ended with a performance of aic = -115.082401239818
Current interaction being tested is between variables  and  with a probability of acceptance of 3.81812619596301e-18
Iteration 27 ended with a performance of aic = -108.742704134686
Current interaction being tested is between variables  and  with a probability of acceptance of 2.76120639944941e-20
Iteration 28 ended with a performance of aic = -119.125300964301
Current interaction being tested is between variables  and  with a probability of acceptance of 1.82341064204502e-18
Error in `[<-`(`*tmp*`, , paste0("X", j, "_", lev[[j]][[1]][which(!lev[[j]][[1]] %in%  : 
  subscript out of bounds
Calls: glmdisc
Execution halted