get_elbow_threshold: Threshold data using the elbow method

Description Usage Arguments Value Examples

View source: R/utils_data.R

Description

Threshold data using the elbow method

Usage

1
get_elbow_threshold(xvals, yvals, upper_plateau = FALSE)

Arguments

xvals

X values

yvals

Y values

upper_plateau

If TRUE, instead of connecting the first and last data points, the left support is chosen such that no points are above the line. This is useful if there are a few outliers with very low X values.

Value

The threshold, i.e. the value of the X axis where the distance between the Y value and the line connecting the first and last points is maximal.

Examples

1
2
3
     xvals <- 1:20
     yvals <- c(20:11, -0.2 * 1:10 + 11)
     get_elbow_threshold(xvals, yvals)

ilia-kats/RiboSeqTools documentation built on Oct. 5, 2020, 7:41 p.m.