I am using R for a project and I have a data frame in in the following format:
A B C 1 1 0 0 2 0 1 1
I want to return a data frame that gives the Column Name when the value is 1.
Impair1 Impair2 1 A NA 2 B C
Is there a way to do this for thousands of records? The max impairment number is 4.
Note: There are more than 3 columns. Only 3 were listed to make it easier.