<p>In order to make operations on sets fast, use <a href="http://arxiv.org/pdf/1503.01547.pdf" rel="nofollow noreferrer">binary decision diagrams</a>.</p>

<p>In function of what operations on sets of sets you need, you can choose different variations of BSDs. In the most general case, use the ID of each set on the terminal nodes and do not unify the terminal nodes. </p>

<p>There are thousands of different articles where you can learn how to implement them; comparing to lists and other trivial data structures, to implement BSDs you have lots of different ways to do it, and some more mental effort to do to be able to use them, but after you understand them you will love this data structure.</p>

<p>This is a big intellectual effort to do to understand it, but it will run really fast when you implement list of sets, sets of sets (powerset), as you wish.</p>
For a list of sets: How do I identify all members that are a proper subset of another list member?
<p>Consider the following list where each member contains sets of numbers.</p>

<pre><code>sets &lt;- list(a=1:3, b=2:3, c=4:6, d=4:6, e=7)
</code></pre>

<p>I want to identify all sets that are proper subsets of another set in the list, such that my desired result would look like this...</p>

<pre><code>c(F,T,F,F,F)
</code></pre>

<p>Because my actual sets are quite large, I don't want to need to calculate power sets of each set. Does anyone have a thought for an efficient way to do this? </p>

<p>This is what I've done so far, and it works, but this can't be the most elegant way of doing it.</p>

<pre><code> truthtable &lt;- bind_rows(lapply(X=sets, FUN=function(x, allsets){
  unlist(lapply(X=allsets, FUN=function(x,testset){
    return(all(x %in% testset) &amp; !setequal(x, testset))
  }, testset=x))
}, allsets=sets))

apply(truthtable, 1, function(x){(all(!x))})
</code></pre>