findElbow: Find the elbow of a screeplot or similar
Description
Adapted from
https://stackoverflow.com/questions/2018178/finding-the-best-trade-off-point-on-a-curve
Algorithm: draw a straight line between the two endpoints and find the point
furthest from this line.
Usage
findElbow(d, plot = FALSE)
Arguments
d
dataframe containing x and y coordinates of the points