title: Match a vector to a list of vectors
body: <p>I have a list of vectors <code>lis</code> which I need to match to another vector <code>vec</code></p>
  
  <pre><code>lis &lt;- list(c(2,0,0),c(1,1,0), c(1,0,1), c(0,2,0), c(0,1,1), c(0,0,2))
  vec &lt;- c(1,1,0)
  </code></pre>
  
  <p>So either I would get a logical output</p>
  
  <pre><code> [1] FALSE  TRUE  FALSE  FALSE  FALSE  FALSE
  </code></pre>
  
  <p>Or just the position within <code>lis</code> of the match</p>
  
  <p>I've been trying things along these lines:</p>
  
  <pre><code>unlist(lis) %in% vec
  </code></pre>
  
  <p>but the problem is the position of the number is important i.e. distinguish between <code>c(1,1,0)</code> and <code>c(1,0,1)</code> which I haven't been able to do. I would like to avoid <code>for</code> loops as this needs to be quite efficient (fast).</p>