R/which.max.sec.R

Defines functions max.sec which.max.sec

#' @noRd
which.max.sec <- function(x) {
  
  if(length(x) == 1) {
    
    return(which.max(x))
    
  } else {
    
    y = sort.int(x, decreasing = TRUE, index.return = TRUE)
    return(y$ix[2])
    
  }

}

#' @noRd
max.sec <- function(x) {
  
  if(length(x) == 1) {
    
    return(max(x))
    
  } else {
    
    y = sort(x, decreasing = TRUE)
    return(y[2])
    
  }
  
}
bishun945/FCMm documentation built on Oct. 15, 2021, 6:43 p.m.