title: Why can't pass only 1 coulmn to glmnet when it is possible in glm function in R?
body: <p>Why there is no possibility to pass only 1 explanatory variable to model in <code>glmnet</code> function from <code>glmnet</code> package when it is possible in <code>glm</code> function from base?
  Code and error are below:</p>
  
  <pre><code>&gt; modelX&lt;-glm( ifelse(train$cliks &lt;1,0,1)~(sparseYY[,40]), family="binomial")
  &gt; summary(modelX)
  
  Call:
  glm(formula = ifelse(train$cliks &lt; 1, 0, 1) ~ (sparseYY[, 40]), 
      family = "binomial")
  
  Deviance Residuals: 
      Min       1Q   Median       3Q      Max  
  -0.2076  -0.2076  -0.2076  -0.2076   2.8641  
  
  Coefficients:
                 Estimate Std. Error  z value Pr(&gt;|z|)    
  (Intercept)    -3.82627    0.00823 -464.896   &lt;2e-16 ***
  sparseYY[, 40] -0.25844    0.15962   -1.619    0.105    
  ---
  Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
  
  (Dispersion parameter for binomial family taken to be 1)
  
      Null deviance: 146326  on 709677  degrees of freedom
  Residual deviance: 146323  on 709676  degrees of freedom
  AIC: 146327
  
  Number of Fisher Scoring iterations: 6
  
  &gt; modelY&lt;-glmnet( y =ifelse(train$cliks &lt;1,0,1), x =(sparseYY[,40]), family="binomial"  )
  Błąd wif (is.null(np) | (np[2] &lt;= 1)) stop("x should be a matrix with 2 or more columns")
  </code></pre>