Closed abhsarma closed 4 years ago
is this different from what the .options argument does?
kinda?? I see the .options
as a way to use indexing to get around this problem as it only expands sequences currently? Maybe .options can be expanded to also support lists and values in a list?
To make things concrete, something like:
branch("param", .options = list("option1" ~ 1, "option2" ~ 2))
Should be equivalent to:
branch("param", "option1" ~ 1, "option2" ~ 2)
And this:
branch("param", .options = c(1,2,3))
Is equivalent to:
branch("param", 1,2,3)
?
If this is the case than both vectors and lists are covered by having .options
just expand out whatever it is passed into arguments. That makes for a nice, simple rule that covers both cases?
yes I was thinking of something along those lines. I think Alex was trying to do write up some code for some meta-analysis which requires considering all possible (permuted) subsets of a set of studies, and declaring that within a branch statement is more difficult than if you have a list (from say gtools::permutations
) which would create it for you, and branch could create a universe for each item in the list.
So we should have this?
yeah definitely! I just assumed the existing .options
implementation already was this :)
Could it be useful if we provide a list to branch as argument and it expands the list to create a set of options?