title: YAVL: Yet another vectorized loop in R
body: <p>I'm only just getting a handle on vectorizing code with R (links to useful examples would help), and I'm trying to find a faster way of handling this loop. a,b,c all have a bunch of numbers in them and I'm trying to find any particular number that occurs in all 3 columns. The loop works, but is super slow:</p>
  
  <pre><code>for(i in 1:length(a)){
    if(any(a[i]==b))
      if(any(a[i]==c))
        print(a[i])
  }
  </code></pre>
  
  <p>Is there an apply function that would work really well here?</p>