I am trying to create three new columns with values depending on a particular order of three logical type columns.
eg I have this:
a b c
1 TRUE TRUE TRUE
2 TRUE FALSE TRUE
3 TRUE FALSE TRUE
And depending if going across the row the values are TRUE, TRUE, TRUE as in row 1, then create three new columns with the values 1,1,1 but if the order is TRUE,FALSE,TRUE as in row 2 and 3 then the values would be 2,3,3. Just to note, a value of TRUE does not = 1 but rather a value I define depending on all three logical values (A total of 8 possible combinations each defined by three separate numbers). So I get something like this:
a b c d e f
1 TRUE TRUE TRUE 5 5 2
2 TRUE FALSE TRUE 2 3 3
3 TRUE FALSE TRUE 2 3 3
If someone could point me in the right direction to do this as efficiently as possible it would be greatly appreciated as I am relatively new to R.