I have a list of TRUE/FALSE statements in two columns. I want to determine if a test passes before it fails, a test fails before it passes, or neither. I am trying to create an output for each situation as well.
So for example if a test passes before it fails
Pass Fail
1 TRUE FALSE
2 FALSE FALSE
3 FALSE FALSE
I want the output to say which event occurred and then the row number at which it occurred so for the example above the output would look like this
Pass 1
Another example of a test that failed
Pass Fail
1 FALSE FALSE
2 FALSE TRUE
3 TRUE FALSE
The expected output would look like
Fail 2
And then a situation where there was no pass or fail
Pass Fail
1 FALSE FALSE
2 FALSE FALSE
3 FALSE FALSE
and the expected output would be
None 0
As I mentioned before, I want to find out which event occurs first.
Pass dataset
structure(list(Pass = c(TRUE, FALSE, FALSE), Fail = c(FALSE,
FALSE, FALSE)), row.names = c(NA, 3L), class = "data.frame")
Fail dataset
structure(list(Pass = c(FALSE, FALSE, TRUE), Fail = c(FALSE,
TRUE, FALSE)), row.names = c(NA, 3L), class = "data.frame")
None dataset
structure(list(Pass = c(FALSE, FALSE, FALSE), Fail = c(FALSE,
FALSE, FALSE)), row.names = c(NA, 3L), class = "data.frame")