widyr
widyr copied to clipboard
Feature request: pairwise function
I was wondering if there was a function that takes the pairwise differences (A-B)... And then I realized maybe having a function that applies any function and applies it in a pairwise manner. Something like:
# subtract
df %>%
pairwise(.f = '-')
# add
df %>%
pairwise(.f = '+')
# multiply
df %>%
pairwise(.f = '*')
Would this be useful? If there's interest I might try implementing something like that.
This would be really useful. I thought I could figure out how to add my own function ahead of squarely, but ran into a wall.