R/which.min2.R

Defines functions which.min2

Documented in which.min2

#' Find the min of a list starting from the end
#'
#' @param x list of elements
#' @param last.index starting from the last index (=TRUE). Default is false
#' @param ... hypotetical additional elements
#'
#' @return
#' @export
#'
#' @examples
which.min2 <- function(x, last.index = FALSE, ...){
  if(last.index) max(which(x == min(x, ...))) else which.min(x)
}
cgaillac/RationalExp documentation built on May 28, 2019, 12:01 p.m.