I want to apply a function to all pairs of items in the same group e.g.
Example input:
Group Item Value
A 1 89
A 2 76
A 3 2
B 4 21
B 5 10
The desired output is a vector of the function output for all items in the same group.
e.g. for arguments sake if the function was:
addnums=function(x,y){
x+y
}
Then the desired output would be:
165, 91, 78, 31
I have tried to do this using summarize in the dplyr package but this can only be used if the output is a single value.