I have a data.table in R for example:
x <- data.table( id = c(1:10), count=c(10,110,20,30,5,40,50,15,20,70))
I want to select all subsets respectively combinations of id where the rowsum of count is between 90 and 110. One combination would be 105
id IN (1,3,4,5,6)
because the sum of count would be
x[id %in% c(1,3,4,5,6), sum(count)]
How do I get all possible combinations?