findElbow: Find the elbow of a screeplot or similar

View source: R/math.R

findElbowR Documentation

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

Examples

y = c(10, 11, 8, 4, 2, 1.5, 1, 0.7, .5, .4, .3)
soundgen:::findElbow(data.frame(x = 1:length(y), y = y), plot = TRUE)

soundgen documentation built on Sept. 12, 2024, 6:29 a.m.