title: Getting number of rows in a data frame for each value in a list where each row in the data frame has multiple columns that may contain the value
body: <p>So I have a list of values:</p>
  
  <pre><code>Value
  AAA
  BBB
  CCC
  .
  .
  .
  ZZZ
  </code></pre>
  
  <p>Now I have a data frame where each row has 15 column that can contain these values as such:</p>
  
  <pre><code>ID V1   V2   V3   V4   V5   V6   V7   V8   V9   V10   V11   V12   V13   V14  V15
  1  AAA
  2  AAA  BBB
  3  CCC  BBB
  </code></pre>
  
  <p>Basically, I'd like a count of rows from this data frame for each value in that list where it can show up in any of the 15 columns:</p>
  
  <p>Desired output:</p>
  
  <pre><code>Value  Count
  AAA     2
  BBB     2
  CCC     1
  .
  .
  .
  ZZZ     0
  </code></pre>
  
  <p>I've tried using sapply and apply like the following but this doesn't seem to work:</p>
  
  <pre><code>apply(mylist$values, 2, function(x) { length(which(df[,2:16] %in% x)) } )
  </code></pre>
  
  <p>or</p>
  
  <pre><code>sapply(mylist$values, function(x) { length(which(x %in% df[,2:16])) })
  </code></pre>
  
  <p>I'd appreciate any ideas!</p>
  
  <p>Thanks,</p>