For bivariate data that show monotonic decreases (e.g. plots of trajectory
count vs. frame gap allowed, or scree plots from PCAs), this function will
find the "elbow" point. This is done by drawing an (imaginary) line between
the first observation and the final observation. Then, the distance between
that line and each observation is calculated. The "elbow" of the curve is the
observation that maximizes this distance.
If export_type is row_num the row number of the elbow
point is returned. If anything else is used for that argument, the entire
row of the original data frame on which the "elbow" is located is returned.
If plot_curve is TRUE, the curve is plotted along with a
vertical line drawn at the computed elbow point.
Arguments
data_frame
A two-column data frame (numeric entries only), ordered
x-axis first, y-axis second.
export_type
If "row_num" (the default), the row number of the elbow
point is returned. If anything else, the entire row of the original data
frame is returned.