Running examples in ‘BeSS-Ex.R’ failed
The error most likely occurred in:

> ### Name: bess
> ### Title: Best subset selection
> ### Aliases: bess
> 
> ### ** Examples
> 
> #--------------linear model--------------#
> # Generate simulated data
> n <- 500
> p <- 20
> K <-10
> sigma <- 1
> rho <- 0.2
> data <- gen.data(n, p, family = "gaussian", K, rho, sigma)
> 
> # Best subset selection
> fit1 <- bess(data$x, data$y, family = "gaussian")
1-th iteration s.left:1 s.split:13 s.right:20
2-th iteration s.left:1 s.split:8 s.right:13
3-th iteration s.left:8 s.split:11 s.right:13
4-th iteration s.left:8 s.split:10 s.right:11
5-th iteration s.left:8 s.split:9 s.right:10
> print(fit1)
     Df          MSE         AIC        BIC       EBIC
[1,]  1 1.148634e+04 4676.456988 4680.67160 4686.66306
[2,] 20 9.403456e-01    9.246090   93.53825  213.36754
[3,] 13 9.425642e-01   -3.575607   51.21430  129.10334
[4,]  8 7.974707e+01 2205.430029 2239.14689 2287.07861
[5,] 11 9.481784e-01   -4.606322   41.75437  107.66048
[6,] 10 9.525680e-01   -4.296912   37.84917   97.76381
[7,]  9 2.730445e+01 1671.524785 1709.45626 1763.37944
> #coef(fit1, sparse=TRUE)  # The estimated coefficients
> bestmodel <- fit1$bestmodel
> #summary(bestmodel)
> 
> # Plot solution path and the loss function
> plot(fit1, type = "both", breaks = TRUE)
> 
> ## Not run:
> #--------------logistic model--------------#
> 
> # Generate simulated data
> data <- gen.data(n, p, family="binomial", 5, rho, sigma)
> 
> # Best subset selection
> fit2 <- bess(data$x, data$y, s.list = 1:10, method = "sequential",
+              family = "binomial", epsilon = 0)
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
> print(fit2)
      Df       Dev      AIC      BIC     EBIC
 [1,]  1 629.11867 631.1187 635.3333 641.3247
 [2,]  2 453.81904 457.8190 466.2483 478.2312
 [3,]  3 302.58928 308.5893 321.2331 339.2075
 [4,]  4 176.84372 184.8437 201.7022 225.6680
 [5,]  5 106.86073 116.8607 137.9338 167.8911
 [6,]  6 103.55627 115.5563 140.8439 176.7927
 [7,]  7 102.14096 116.1410 145.6432 187.5835
 [8,]  8 100.73884 116.7388 150.4557 198.3874
 [9,]  9  99.80480 117.8048 155.7363 209.6595
[10,] 10  99.49283 119.4928 161.6389 221.5536
> #coef(fit2, sparse = TRUE)
> bestmodel <- fit2$bestmodel
> #summary(bestmodel)
> 
> # Plot solution path and the loss function
> plot(fit2, type = "both", breaks = TRUE, K = 5)
> 
> #--------------cox model--------------#
> 
> # Generate simulated data
> data <- gen.data(n, p, 5, rho, sigma, c = 10, family = "cox", scal = 10)
censoring rate: 0.136 
> 
> # Best subset selection
> fit3 <- bess(data$x, data$y, s.list = 1:10, method = "sequential",
+              family = "cox")
> print(fit3)
      Df      Dev      AIC      BIC     EBIC
 [1,]  1 4445.710 4447.710 4451.924 4457.916
 [2,]  2 4364.320 4368.320 4376.750 4388.733
 [3,]  3 3958.770 3964.770 3977.414 3995.388
 [4,]  4 3048.133 3056.133 3072.991 3096.957
 [5,]  5 2671.186 2681.186 2702.259 2732.216
 [6,]  6 2669.363 2681.363 2706.651 2742.600
 [7,]  7 2667.583 2681.583 2711.085 2753.026
 [8,]  8 2666.312 2682.312 2716.029 2763.961
 [9,]  9 2665.032 2683.032 2720.964 2774.887
[10,] 10 2664.385 2684.385 2726.531 2786.446
> #coef(fit3, sparse = TRUE)
> bestmodel <- fit3$bestmodel
> #summary(bestmodel)
> 
> # Plot solution path and the loss function
> plot(fit3, type = "both", breaks = TRUE, K = 5)
> 
> 
> #----------------------High dimensional linear models--------------------#
> 
> p <- 1000
> data <- gen.data(n, p, family = "gaussian", K, rho, sigma)
> 
> # Best subset selection
> fit <- bess(data$x, data$y, method="sequential", family = "gaussian", epsilon = 1e-12)
> 
> # Plot solution path
> plot(fit, type = "both", breaks = TRUE, K = 10)
> 
> 
> data("prostate")
> x = prostate[,-9]
> y = prostate[,9]
> 
> fit.group = bess(x, y, s.list = 1:ncol(x), factor = c("gleason"))
Error in bess(x, y, s.list = 1:ncol(x), factor = c("gleason")) : 
  x should be two columns at least!
Execution halted