quantile.distmap: Calculates quantiles of one of the PDFs in a distmap object.

Description Usage Arguments Value Examples

View source: R/quantile.distmap.R

Description

This function does not use any of the quantile algorithms used by the default quantile function. Instead, it integrates the PDF in the distmap object via the trapezoid rule to get a CDF, and then inverts the CDF using splinefun.

Usage

1
2
3
## S3 method for class 'distmap'
quantile(x, probs = c(5, 10, 25, 50, 75, 90, 95)/100,
  which = c("xpdf", "ypdf"), ...)

Arguments

x

An object of class 'distmap'.

probs

A vector of probabilities. Values outside [0,1] are set to NA. Defaults to percentiles useful for plotting distmap objects.

which

The name of the pdf (xpdf or ypdf) to use for quantiles. Defaults to "xpdf".

...

Further arguments passed from other functions.

Value

The return value of the function.

Examples

1
2
3
4
5
6
set.seed(222)
x <- rnorm(1000)
y <- rnorm(1000, mean=3, sd=2)
d <- distmap(x, y)
quantile(d)
quantile(d, which="ypdf", prob=c(25,50,75)/100)

sethmcg/climod documentation built on Nov. 19, 2021, 11:12 p.m.