title: Filtering of an array in a list type data.table column
body: <p>I'm trying to solve a problem in which for a new route (of a truck) that I just found, I check if that route was already a part of a previous route I have. For instance, assume my stored routes are in datatable <code>routelist</code> and <code>node_list</code> refers to the stored routes. I want to check the rows in which route (5,6,7,8) is part of.  </p>
  
  <pre><code>library(data.table)
  routelist=data.table(id=c(1:3),node_list=list(c(1:6),c(4:7),c(1:10)))
  item&lt;-c(5:8)
  routelist[sum(item%in%unlist(packlist$node_list))==length(item)]
  </code></pre>
  
  <p>For the above check, all three rows are returned however only the third row should be returned. I could do it with the following for loop, but it s not fast and does not take order into account (and there should be a way to do it in a better way). The order of nodes in <code>item</code> is important and the list does not need to be consecutive i.e. item could be <code>c(5,7,8)</code> and should be returned in 3rd row while <code>c(5,8,7)</code> shouldnt return.   </p>
  
  <pre><code>for(i in 1:3)
  {
    if(sum(item%in%unlist(packlist[i]$node_list))==length(item))
      print(routelist[i])
  }
  </code></pre>