How to get all consecutive subsets of a vector?

If I want to get all subsets of a vector I can e.g. use the sets package: library(sets) v <- c(“test1”, “test2”, “test3”, “test4”) set_power(v) ## {{}, {“test1”}, {“test2”}, {“test3”}, {“test4”}, {“test1”, ## “test2”}, {“test1”, “test3”}, {“test1”, “test4”}, {“test2”, ## “test3”}, {“test2”, “test4”}, {“test3”, “test4”}, {“test1”, ## “test2”, “test3”}, {“test1”, “test2”, “test4”}, {“test1”, ## “test3”, … Read more