R/which2.R

Defines functions which.max2 which.min2

Documented in which.max2 which.min2

#' which.min who handles all NA returning NA
#' 
#' which.min who handles all NA returning NA
#'
#' @param x a vector
#' @export
which.min2 <- function(x){
    if (all(is.na(x))) NA  else which.min(x)
}

#' which.max who handles all NA returning NA
#' 
#' which.max who handles all NA returning NA
#'
#' @param x a vector
#' @export
which.max2 <- function(x){
    if (all(is.na(x))) NA  else which.max(x)
}
lbraglia/lbmisc documentation built on April 29, 2024, 11:27 a.m.