R/Range.R

Defines functions Range

Documented in Range

Range = function(y)
{
  y = as.numeric(y)  
  if (!(is.numeric(y) & is.vector(y))) return(NA) # stop("Input should be a numeric vector!")
  y = y[!is.na(y)]
  if (length(y) == 0) return(NA)
  max(y, na.rm=TRUE) - min(y, na.rm=TRUE)
}

Try the sasLM package in your browser

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

sasLM documentation built on June 22, 2024, 6:55 p.m.