R/findExtreme.R

Defines functions .findExtreme

#'
#' Find Extreme Values in a Matrix
#'
#' @export
#' @noRd
#'

.findExtreme <- function(M) {
  # Find the most extreme value in a numerical object (matrix)
  # and return the absolute value of that extreme
  # Must handle NAs
  M <- M[!is.na(M)]
  ex <- abs(range(M))
  ex <- ex[which.max(ex)]
  return(ex)
}

Try the ChemoSpec2D package in your browser

Any scripts or data that you put into this service are public.

ChemoSpec2D documentation built on Oct. 11, 2021, 9:06 a.m.