I have a dataframe that looks something like this:
M0 M1 M2 M3 M4 M5 M6 M7 M8 1 1 0 0 0 NA NA NA NA 2 2 2 2 2 2 2 0 0 2 2 2 2 2 0 NA NA NA 2 2 2 2 2 0 0 0 0
What I would like to know is the position (column) of the last value larger than 0 in each row.
The desired output would be a vector containing these indexed positions
here: (M1, M6, M4, M4)