R/quantiles.R

Defines functions q75 q25

Documented in q25 q75

#' Return the 25th percentile.
#' 
#' @param x numeric vector.
#' @param na.rm	logical; if true, any NA and NaN's are removed from x before the
#'        quantiles are computed
#' @param ... other parameters passed to \code{\link{quantile}}.
#' @export
#' @return the 25th percentile.
q25 <- function(x, na.rm = FALSE, ...) {
	return(unname(quantile(x, na.rm=na.rm, ...)[2]))
}

#' Returns the 75th percentile.
#' 
#' @param x numeric vector.
#' @param na.rm	logical; if true, any NA and NaN's are removed from x before the
#'        quantiles are computed
#' @param ... other parameters passed to \code{\link{quantile}}.
#' @export
#' @return the 75th percentile.
q75 <- function(x, na.rm = FALSE, ...) {
	return(unname(quantile(x, na.rm=na.rm, ...)[4]))
}
jbryer/PSAboot documentation built on Oct. 29, 2023, 10 a.m.