quantilefun.im | R Documentation |
Return the inverse function of the cumulative distribution function of pixel values in an image.
## S3 method for class 'im'
quantilefun(x, ..., type=1)
x |
Pixel image (object of class |
... |
Other arguments passed to methods. |
type |
Integer specifying the type of quantiles,
as explained in |
Whereas the command quantile
calculates
the quantiles of a dataset corresponding to desired probabilities
p
, the command quantilefun
returns a function which can be used to compute any quantiles of the
dataset.
If f <- quantilefun(x)
then f
is a function such that
f(p)
is the quantile associated with any given probability p
.
For example f(0.5)
is the median of the original data, and
f(0.99)
is the 99th percentile of the original data.
If x
is a pixel image (object of class "im"
)
then the pixel values of x
will be extracted
and the quantile function of the pixel values is constructed.
A function in the R language.
.
quantilefun
,
ewcdf
,
quantile.ewcdf
,
ecdf
,
quantile
## image data: terrain elevation
Z <- bei.extra$elev
if(require(spatstat.explore)) {
FE <- spatialcdf(Z, normalise=TRUE)
} else {
FE <- ecdf(Z[])
}
QE <- quantilefun(FE)
QE(0.5) # median elevation
if(interactive()) plot(QE, xlim=c(0,1),
xlab="probability", ylab="quantile of elevation")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.