title: glmnet error for logistic regression/binomial
body: <p>I get this error when trying to fit glmnet() with family="binomial", for Logistic Regression fit:</p>
  
  <pre><code>&gt; data &lt;- read.csv("DAFMM_HE16_matrix.csv", header=F)
  &gt; x &lt;- as.data.frame(data[,1:3])
  &gt; x &lt;- model.matrix(~.,data=x)
  &gt; y &lt;- data[,4]
  
  &gt; train=sample(1:dim(x)[1],287,replace=FALSE)
  
  &gt; xTrain=x[train,]
  &gt; xTest=x[-train,]
  &gt; yTrain=y[train]
  &gt; yTest=y[-train]
  
  &gt; fit = glmnet(xTrain,yTrain,family="binomial")
  
  Error in lognet(x, is.sparse, ix, jx, y, weights, offset, alpha, nobs,  : 
  one multinomial or binomial class has 1 or 0 observations; not allowed
  </code></pre>
  
  <p>Any help would be greatly appreciated - I've searched the internet and haven't been able to find anything that helps</p>
  
  <p>EDIT:</p>
  
  <p>Here's what data looks like:</p>
  
  <pre><code>&gt; data
            V1       V2    V3      V4
  1   34927.00   156.60 20321  -12.60
  2   34800.00   156.60 19811  -18.68
  3   29255.00   156.60 19068    7.50
  4   25787.00   156.60 19608    6.16
  5   27809.00   156.60 24863   -0.87
  ...
  356 26495.00 12973.43 11802    6.35
  357 26595.00 12973.43 11802   14.28
  358 26574.00 12973.43 11802    3.98
  359 25343.00 14116.18 11802   -2.05
  </code></pre>