I have a column as below. Only for non-null elements, I want to get a matrix such as below. 6th column represent the actual value.
1 0 0 0 0 1 0 1 0 0 0 2 0 0 0 1 0 5 Any hint what is the efficient way to do this? which commands should I use? I am thinking of writing a if loop within for loop, but don't think it will be very efficient :(
abc=c('1','2','null','5','null')