R/max2.R

Defines functions max2

Documented in max2

#' returns one but highest contribution
#' @keywords internal
max2 <- function(x, default_value = 0, na.rm=TRUE){
  if (length(x) > 1){
    x[order(x, decreasing = TRUE)][2]
  } else {
    default_value
  }
}

Try the sdcSpatial package in your browser

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

sdcSpatial documentation built on March 24, 2022, 5:05 p.m.