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

> ### Name: print.logreg
> ### Title: Prints Logic Regression Output
> ### Aliases: print.logreg
> ### Keywords: logic methods nonparametric tree
> 
> ### ** Examples
> 
> data(logreg.savefit1,logreg.savefit2,logreg.savefit3,logreg.savefit4,
+      logreg.savefit5,logreg.savefit6)
> #
> # fit a single model
> # myanneal <- logreg.anneal.control(start = -1, end = -4, iter = 25000, update = 1000)
> # logreg.savefit1 <- logreg(resp = logreg.testdat[,1], bin=logreg.testdat[, 2:21],
> #                type = 2, select = 1, ntrees = 2, anneal.control = myanneal)
> # the best score should be in the 0.96-0.98 range
> print(logreg.savefit1)
score 0.966 
1.98 -1.3 * (((X14 or (not X5)) and ((not X1) and (not X2))) and (((not X3) or X1) or ((not X20) and (not X2)))) +2.15 * (((not X4) or ((not X13) and (not X11))) and (not X3))
> #
> # fit multiple models
> # myanneal2 <- logreg.anneal.control(start = -1, end = -4, iter = 25000, update = 0)
> # logreg.savefit2 <- logreg(select = 2, ntrees = c(1,2), nleaves =c(1,7),
> #                oldfit = logreg.savefit1, anneal.control = myanneal2)
> print(logreg.savefit2)
1 trees with 1 leaves: score is 1.15 
3.79 -1.91 * X3
1 trees with 2 leaves: score is 1.048 
1.87 +2.13 * ((not X3) and (not X4))
1 trees with 3 leaves: score is 1.046 
1.85 +2.14 * ((not X3) and ((not X13) or (not X4)))
1 trees with 4 leaves: score is 1.042 
1.86 +2.14 * ((((not X13) and (not X11)) or (not X4)) and (not X3))
1 trees with 5 leaves: score is 1.042 
1.86 +2.14 * ((not X3) and ((not X4) or ((not X13) and (not X11))))
1 trees with 6 leaves: score is 1.042 
4 -2.14 * (X3 or (X4 and (X13 or (not X19))))
1 trees with 7 leaves: score is 1.04 
1.84 +2.15 * ((((not X4) or (not X13)) and (not X3)) or (((not X6) and X14) and ((not X1) and (not X12))))
2 trees with 2 leaves: score is 1.117 
1.98 +1.89 * (not X3) -0.904 * X4
2 trees with 3 leaves: score is 1.033 
1.58 +0.401 * X1 +2.13 * ((not X3) and (not X4))
2 trees with 4 leaves: score is 0.988 
4.12 -1.11 * ((not X1) and (not X2)) -2.12 * (X3 or X4)
2 trees with 5 leaves: score is 0.982 
0.77 +1.22 * ((X2 or X1) or X20) +2.12 * ((not X4) and (not X3))
2 trees with 6 leaves: score is 0.979 
0.764 +2.13 * ((not X3) and (not X4)) +1.23 * ((X2 or X1) or (X20 and X3))
2 trees with 7 leaves: score is 0.978 
1.99 +2.13 * ((not X3) and (not X4)) -1.29 * (((not X7) or ((not X5) or (not X15))) and ((not X1) and (not X2)))
> # After an initial steep decline, the scores only get slightly better
> # for models with more than four leaves and two trees.
> #
> # cross validation
> # logreg.savefit3 <- logreg(select = 3, oldfit = logreg.savefit2)
> print(logreg.savefit3)
    ntree nleaf train.ave    train.sd  cv/test cv/test.sd
10      1     1 1.1498841 0.016778885 1.167571 0.15626639
20      1     2 1.0478746 0.011226685 1.069748 0.10832190
30      1     3 1.0449851 0.010941456 1.086064 0.08148609
40      1     4 1.0415285 0.011277524 1.073501 0.11002902
50      1     5 1.0407865 0.010747466 1.103262 0.10778810
60      1     6 1.0375888 0.016061698 1.081281 0.08087984
70      1     7 1.0389121 0.012111442 1.083661 0.08286943
80      2     2 1.0742266 0.029866724 1.113556 0.14902853
90      2     3 1.0331042 0.009432286 1.069458 0.09146249
100     2     4 0.9880183 0.009248304 1.028298 0.08375898
110     2     5 0.9819231 0.008823874 1.034018 0.09038718
120     2     6 0.9780617 0.009782010 1.045832 0.09437465
130     2     7 0.9752644 0.008960632 1.059286 0.10264426
> # 4 leaves, 2 trees should give the best test set score
> #
> # null model test
> # logreg.savefit4 <- logreg(select = 4, anneal.control = myanneal2, oldfit = logreg.savefit1)
> print(logreg.savefit4)
Null Score 1.494 ; best score 0.969 
Summary 25 Randomized scores
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
  1.398   1.411   1.423   1.421   1.428   1.444 
0  randomized scores ( 0 %) are better than the best score
> # A summary of the permutation test
> #
> # Permutation tests
> # logreg.savefit5 <- logreg(select = 5, oldfit = logreg.savefit2)
> print(logreg.savefit5)
Error in `[<-.data.frame`(`*tmp*`, uu[, 2] == 0, 1, value = 0) : 
  replacement has 1 row, data has 0
Calls: print -> print.logreg -> [<- -> [<-.data.frame
Execution halted