title: R glmnet error binary logistic
body: <p>I am looking for some help figuring out what is causing an error in my attempt to fit a regularized logistic regression (specifically finding the optimal lambda value using cv.glmnet).</p>
  
  <p>Running the following command:</p>
  
  <pre><code>RegLR_CV&lt;-cv.glmnet(x=train.sub.clean[,-c(431)],
                      y=as.factor(train.sub$finalAttrite),
                      family="binomial")
  </code></pre>
  
  <p>where the table <code>train.sub.clean</code> are all numeric and has had all zero variance variables removed (using the <code>caret</code> package).</p>
  
  <p>This function runs for a while then produces the following error. Can anyone recommend what I should be looking for to troubleshoot? It must be my data set as the toy examples in the package run fine.</p>
  
  <blockquote>
    <p>Error:</p>
    
    <p>Error in as.matrix(cbind2(1, newx) %*% nbeta) :   error in evaluating
    the argument 'x' in selecting a method for function 'as.matrix': Error
    in t(.Call(Csparse_dense_crossprod, y, t(x))) :   error in evaluating
    the argument 'x' in selecting a method for function 't': Error:
    invalid class 'NA' to dup_mMatrix_as_dgeMatrix</p>
  </blockquote>
  
  <p>R: 
  R version 2.13.0 (2011-04-13)
  Platform: x86_64-pc-mingw32/x64 (64-bit)</p>
  
  <p>glmnet: 1.7 </p>