quantile.spectra: Compute spectra quantiles

View source: R/stats_function_overloads.R

quantile.spectraR Documentation

Compute spectra quantiles

Description

quantile computes quantiles by band and returns them as 'spectra'.

Usage

## S3 method for class 'spectra'
quantile(
  x,
  probs = c(0.025, 0.25, 0.5, 0.75, 0.975),
  na.rm = TRUE,
  names = NULL,
  ...
)

Arguments

x

spectra object. Must have at least the same number of sample that length(probs) has.

probs

Probabilities to compute quantiles. Must be a vector of numerics between 0.0 and 1.0. Defaults to c(0.025, 0.25, 0.5, 0.75, 0.975). Duplicated probs will be removed.

na.rm

remove NAs before computing quantiles? Defaults to TRUE

names

names for each quantile spectrum. If NULL (default), names are set to 'probs'. A char vector should otherwise be given. Recycled.

...

other arguments passed to quantile.

Value

spectra object with one spectrum for each prob

Author(s)

Jose Eduardo Meireles

Examples

library(spectrolab)
spec = as_spectra(spec_matrix_example, name_idx = 1)
quantile(spec, probs = c(0.25, 0.75))

annakat/spectrolab documentation built on Oct. 14, 2023, 1:16 a.m.