Re: [R] Combinations of true/false values where one pair is mutually exclusive

2018-08-03 Thread S Ellison
> Given that clarification, I'd just generate the full set and remove > the ones you aren't interested in, as in: I'd agree; that is probably the most efficient thing to do with only half a dozen binary variables and a single condition. A way of going about it for a more complex case might be to

Re: [R] Combinations of true/false values where one pair is mutually exclusive

2018-08-02 Thread Bert Gunter
Logic: !(E == "fail" & F == "fail) <==> (E == "pass" | F == "pass") -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Thu, Aug 2, 2018 at 8:57 AM,

Re: [R] Combinations of true/false values where one pair is mutually exclusive

2018-08-02 Thread Sarah Goslee
Given that clarification, I'd just generate the full set and remove the ones you aren't interested in, as in: scenarios <- expand.grid(A = c("pass", "fail"), B = c("pass", "fail"), C = c("pass", "fail"), D = c("pass", "fail"), E = c("pass", "fail"), F = c("pass", "fail")) scenarios <-

Re: [R] Combinations of true/false values where one pair is mutually exclusive

2018-08-02 Thread MacQueen, Don via R-help
From what I can tell, the simplest way is to First generate all the combinations Then exclude those you don't want. Here's an example, with only three variables (D, E, and F), that excludes those where E and F both fail > tmp <- c('p','f') > X <- expand.grid(D=tmp, E=tmp, F=tmp) > X <-

Re: [R] Combinations of true/false values where one pair is mutually exclusive

2018-08-02 Thread R Stafford
Thank you for pointing that out, I realize not only did I use the wrong language but I did not describe the situation accurately. I do need to address the situation where both variables E and F actually pass, that is the majority case, one or the other can fail, but there can never be a situation

Re: [R] Combinations of true/false values where one pair is mutually exclusive

2018-08-02 Thread S Ellison
> On Thu, Aug 2, 2018 at 11:20 AM, R Stafford > wrote: > > But I have the extra condition that if E is true, then F must be false, and > > vice versa, Question: Does 'vice versa' mean a) "if E is False, F must be True" or b) "if F is True, E must be False"? ... which are not the same. b) (and

Re: [R] Combinations of true/false values where one pair is mutually exclusive

2018-08-01 Thread Jim Lemon
Hi Rod, How about this? scenarios <- expand.grid(A = c("pass", "fail"), B = c("pass", "fail"), C = c("pass", "fail"), D = c("pass", "fail"), E = c("pass", "fail")) scenarios$F<-ifelse(scenarios$E=="pass","fail","pass") Jim On Thu, Aug 2, 2018 at 11:20 AM, R Stafford wrote: > I have 6

[R] Combinations of true/false values where one pair is mutually exclusive

2018-08-01 Thread R Stafford
I have 6 variables, (A,B,C,D,E,F) that can either pass or fail (i.e., true or false). I can get a table of all pass/fail combinations with this: scenarios <- expand.grid(A = c("pass", "fail"), B = c("pass", "fail"), C = c("pass", "fail"), D = c("pass", "fail"), E = c("pass", "fail"), F =