extracting common elements from a list and a vector in a list form
<p>I have a list which contains different elements and a vector which list some of the elements, I would like to find out in which list index number does each  element fall into. </p>

<pre><code>x &lt;- list ( c ( 1,2 ), c( 3,4 ), c( 5,6 ), c( 7,8 ), c( 9,10 ) , c( 11,12 ))
y &lt;- c( 2,3,4,6,8,10,11,12 )

# Desired Output in a list 

[[1]]
[1] 2

[[2]]
[1] 3 4

[[3]]
[1] 6

[[4]]
[1] 8

[[5]]
[1] 10

[[6]]
[1] 11 12
</code></pre>

<p>If both were two vectors I would use intersect and which as to find out the possition in x of elements in y</p>