turning_point {beadplexr}R Documentation

Turning points


Find turning points (minima and maxima) in a vector.


  .which = c("both", "minima", "maxima"),
  .return = c("value", "index"),
  .adjust = 1.5,
  .k = NULL,



A numeric vector or a list of numeric vectors. If the list is named, the names become column names in the returned data.frames


A character indicating the values of interest.


A character giving the desired return type.


A numeric giving the adjustment to the adjust argument of stats::density().


Numeric giving the number of expected clusters.


Arguments passed on to approx_adjust


The interval for possible value of adjust.


The interval for possible value of adjust.


A numeric giving the increment to adjust. Sometimes low values are needed to find a proper adjust value.


A list with the two elements maxima and minima. each element consist of a single data.frame.


.x <- c(rnorm(100, 2, 1), rnorm(100, 9, 1))

turning_point(.x = .x, .adjust = 1)
turning_point(.x = .x, .k = 2)

turning_point(.x = .x, .which = "minima")
turning_point(.x = .x, .which = "maxima")

turning_point(.x = .x, .return = "index")

[Package beadplexr version 0.4.0 Index]