title: Error: dim(X) must have a positive length when using "lapply"
body: <p>When running this command:</p>
  
  <pre><code>tmp &lt;- lapply(tmp, function(y) apply(sapply(y, function(x) unique(grpproc[,2]) %in% x), 1, sum))
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>Error in apply(sapply(y, function(x) unique(grpproc[, 2]) %in% x), 1,  :     
  dim(X) must have a positive length
  </code></pre>
  
  <p>I believe I possibly need a different apply statement there maybe?  Thank you for the help!</p>