R/maxFixNA.R

Defines functions maxFixNA

Documented in maxFixNA

#' max function, removing Inf and -Inf
#'
#' @keywords internal
maxFixNA <- function(minputdata) {
  minputdata[minputdata == Inf] <- NA
  minputdata[minputdata == -Inf] <- NA
  if (sum(!is.na(minputdata)) == 0) {
    return(NA)
  } else {
    return(max(minputdata, na.rm = TRUE))
  }
}

Try the mem package in your browser

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

mem documentation built on Aug. 8, 2025, 6:11 p.m.