Input data.frame looks like this:
col1 col2 col3
          1
     1   
1
     1
1
Which can be generated with this: (thanks to @Sotos)
d2 <- data.frame(col1 = c('', 1, '', 1, '', 1), 
                 col2 = c('', '', 1, '', 1, ''), 
                 col3 = c(1, '', '', '', '', ''), stringsAsFactors = FALSE)
And desired output:
col1
3
2
1
2
1
How to merge columns like that? Empty cells are just empty, but solution with NA could be helpful as i can easily fill them.
 
     
     
     
    