powered by
finds the elbow of a curve that is concave to the line connecting the first and last points.
findElbow(y)
A numeric vector of more than 2 elements w/o NA's
A number, the index of the elbow point.
http://healthcare.ai
This function is developed based on the following function in package ChemoSpecMarkeR https://github.com/bryanhanson/ChemoSpecMarkeR/blob/master/R/findElbow.R
The idea behind the function can be found here https://stackoverflow.com/questions/2018178/finding-the-best-trade-off-point-on-a-curve/2022348#2022348
healthcareai
# NOT RUN { y <- c(8.5, 4.9, 2.8, 2.5, 1.9, 1.1, 1.1, 0.9) plot(y) # concave findElbow(y) y <- c(6,5.5,4,2,1.5) plot(y) # not concave ## findElbow(y) will gave an error # }
Run the code above in your browser using DataLab