I have a dataframe like the following one:
A <- data.frame(Red = c(1,0,0,0),
Blue = c(0,1,0,1),
Yellow = c(0,0,1,0))
I would like to combine the information in order to get this column:
B <- data.frame(Colour = c("Red", "Blue", "Yellow", "Blue"))
that is, the name of the column where a 1 appears on it.