I am attempting to extract the rowname that marking rows that contain a single TRUE value. Please see the following example.
                  Col1  Col2  Col3
Npat             FALSE  TRUE FALSE
Ttc30a1           TRUE FALSE FALSE
Gga1              TRUE  TRUE  TRUE
Gga3             FALSE FALSE FALSE
Gga2             FALSE FALSE  TRUE
I would like to extract the rownames of the rows containing a single unique "TRUE" value and retain information about which column the true value was in. The desired output might look like:
                   Col1  Col2  Col3
Npat             FALSE  TRUE FALSE
Ttc30a1           TRUE FALSE FALSE
Gga2             FALSE FALSE  TRUE
I attempted to use grep and -grep but couldn't get it recognize multiple values in multiple columns. I am sure there is a simple way to do this that I haven't been able to track down yet.
 
     
     
     
    