widyr icon indicating copy to clipboard operation
widyr copied to clipboard

Feature request: pairwise function

Open wvictor14 opened this issue 5 years ago • 1 comments

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.

wvictor14 avatar Jul 26 '19 23:07 wvictor14

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.

ApexHeel avatar Apr 08 '21 19:04 ApexHeel