title: Running glmnet package in R, getting error "missing value where TRUE/FALSE needed", maybe due to missing values?
body: <p>I am trying to use <code>glmnet</code> from the <code>glmnet</code> package to run a LASSO regression.</p>
  
  <p>I am using the following command:</p>
  
  <pre><code>library(glmnet)
  glmnet(a,b,family="binomial",alpha=1)
  </code></pre>
  
  <p>And am getting the error:</p>
  
  <pre><code>&gt; Error in if (!all(o)) { : missing value where TRUE/FALSE needed
  </code></pre>
  
  <p><code>a</code> is a matrix, with numerical values.
  <code>b</code> is a vector with a factor as values.</p>
  
  <p>However, <code>b</code> has some missing values. I am suspecting this might be what is causing the error. However, I don't see an option to exclude <code>NA</code>s in the glmnet documentation.</p>