My problem is the following. I need to generate the combinations of binary outcomes for a sequence of 27 draws, i.e. 000000000000000000000000000, 000000000000000000000000001, ..., 111111111111111111111111111.
In R I would do this with expand.grid
result <- expand.grid(rep(list(0:1), 27)) #Error, object too large for workspace
# 2^27 = 134217728 unique combinations
# write.table(result, "result.csv", row.names=F)
My ultimate goal is to save the resulting object for later use.
Is there a way to iteratively compute the entries of the result
object and save it by appending?
Any idea how I can achieve this?