There is a matrix like this:
m <- matrix(c(F,T,F,T,F,T,F,T,F, F,F,T,F,T,F,T,F,T), nrow=9, ncol=2,
dimnames=list(c(), c('1x2x24','2x2x24')))
1x2x24 2x2x24
[1,] FALSE FALSE
[2,] TRUE FALSE
[3,] FALSE TRUE
[4,] TRUE FALSE
[5,] FALSE TRUE
[6,] TRUE FALSE
[7,] FALSE TRUE
[8,] TRUE FALSE
[9,] FALSE TRUE
Presumably there is only a single TRUE per row. What would be the best way to get a vector like this:
NA, 1x2x24, 2x2x24, 1x2x24, 2x2x24, 1x2x24, 2x2x24, 1x2x24, 2x2x24
One way to get it is to replace each TRUE in each column with column name and each FALSE with NA or "". Then merge all columns across rows with paste(). I'm not quite sure how to do this. Any help is highly appreciated.