powered by
Creates a function that calculates the absolute distance between two values.
abs_distance()
Returns a function taking two arguments, x and y, and returning their absolute difference.
x
y
Adam Struzik
cmp <- abs_distance() cmp(1, 5) # returns 4
Run the code above in your browser using DataLab