I'm trying to figure out how to run a `mutate()` in `dplyr` where I can append a key-value pair back to two columns in the previous line. My data looks like this:

```
dat <- data.frame(group=c('Group1','Group1','Group2','Group2','Group3','Group3'), 
                  sp=c('A','B','A','C','C','B'),
                  value=c(60,10,30,50,20,20))

   group sp value
1 Group1  A    60
2 Group1  B    10
3 Group2  A    30
4 Group2  C    50
5 Group3  C    20
6 Group3  B    20

```

I want to calculate a summarized value per group (in this case, 100 - the grouped total) and then add that as an 'Other' variable in a key column with the corresponding calculated value in the value column. This should look like: 

```
dat <- data.frame(group=c('Group1','Group1','Group1','Group2','Group2','Group2','Group3','Group3','Group3'), 
                  sp=c('A','B','Other','A','C','Other','C','B', 'Other'),
                  value=c(60,10,30,30,50,20,20,20,60))

   group    sp value
1 Group1     A    60
2 Group1     B    10
3 Group1 Other    30
4 Group2     A    30
5 Group2     C    50
6 Group2 Other    20
7 Group3     C    20
8 Group3     B    20
9 Group3 Other    60

```

I can `mutate()` and get another column called other with the value per group, but I need this variable in the sp column. I could also pivot the dataframe wider, calculate the column 'Other' calculating rowwise and then pivoting long again, but I am hoping for a more efficient solution where I don't need to do something like a double pivot step.