R/quantile.R

Defines functions quantile.CompositionMatrix

# STATISTICS: QUANTILE
#' @include AllGenerics.R
NULL

# Quantile =====================================================================
#' @export
#' @method quantile CompositionMatrix
quantile.CompositionMatrix <- function(x, ..., probs = seq(0, 1, 0.25),
                                       na.rm = FALSE, names = TRUE) {
  apply(
    X = x,
    MARGIN = 2,
    FUN = stats::quantile,
    probs = probs,
    na.rm = na.rm,
    names = names,
    ...
  )
}

#' @export
#' @rdname quantile
#' @aliases quantile,CompositionMatrix-method
setMethod("quantile", "CompositionMatrix", quantile.CompositionMatrix)

Try the nexus package in your browser

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

nexus documentation built on Sept. 11, 2024, 6:43 p.m.