R/zrange.R

Defines functions zrange

Documented in zrange

#' Range of z-scores
#'
#' Compute the range of a vector of z-scores.
#'
#' @param x A numeric vector
#' @return A number.
#' @export
#' @examples
#' set.seed(1234);
#' x <- rnorm(
#'     n = 10
#'     );
#' zrange(
#'     x = x
#'     );
zrange <- function(x) {
    if (all(is.na(x))) {
        return(NA);
        }
    zrange <- max(x, na.rm = TRUE) - min(x, na.rm = TRUE);
    zrange;
    }

Try the OutSeekR package in your browser

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

OutSeekR documentation built on April 11, 2025, 5:39 p.m.