So I have a dataframe of user IDs as columns with rows (corresponding to period intervals) with binary variables (where an event happened) like this:

```
date Id1 Id2 id3 id4 id5

row1  1   0   0   1   0
row2  0   0   1   1   0
row3  0   1   0   0   1
row4  1   1   0   0   0
row5  0   0   1   1   1  
...

```

I am trying to build a loop that runs through each row of each column which identifies any cell with a 1 and populates a new data frame with the row number of each occurrence, e.g:

```
  occ. Id1 Id2 id3 id4 id5 
  1    1    3   2   1   3 
  2    4    4   5   2   5
  3                 5    
  4
  5

```

I am pretty lost in how to approach this, if anyone is able to help?