contourAll {GCDkit}R Documentation

Outlining the whole dataset in a binary plot

Description

These functions outline the whole dataset on a binary plot. Implemented methods are the convex hull or contours. This can be useful for a quick appreciation of the data distribution, e.g. in classification diagrams.

Usage

chullAll(border=NULL, fill=FALSE, ...) 

contourAll(cont.levels = c(0.25,0.50,0.75), n = 20, 
    border = NULL, fill = FALSE, fade.away = TRUE,...)

Arguments

border

outline colour.

fill

logical; should be the polygon filled by the border colour?

cont.levels

values (0-1) where contours are to be drawn.

n

density of the grid.

fade.away

logical; shall the colours of individual contours fade away?

...

additional parameters to the functions contour and polygon, respectively.

Details

If not specified, the colours are selected as the most frequently occurring one among the samples within each group.

For the function contourAll, contours are drawn based on percentage of the whole population, based on the kernel density estimation. Their smoothness (vs. speed of computation) is determined by the parameter n. The individual contours can be made increasingly more transparent, as controlled by the parameter fade.away.

contourAll.png

Value

Returns (invisibly) a list with two components:

z

Values of estimated densities for each of the cont.levels.

kde

A matrix of the estimated density: rows correspond to the value of x, columns to the value of y.

Author(s)

Vojtěch Janoušek, vojtech.janousek@geology.cz and

Jean-François Moyen jfmoyen@gmail.com

See Also

chull, optimize kde2d contour, polygon figaro contourGroups chullGroups plotDiagram

Examples

    data(atacazo)
    accessVar("atacazo")
    
    plotDiagram("TAS",FALSE,TRUE)
    figUser(xlim=c(57,68),ylim=c(4,5.7))
    contourAll(n=10,border="gray",fade.away=FALSE)
    
    figRedraw()
    out<-contourAll(n=50,border="darkgray",fade.away=TRUE)
    
    windows()
    xlab<-.fig.deeval(sheet$demo$call$xlab)
    ylab<-.fig.deeval(sheet$demo$call$ylab)
    persp(out[["All"]]$kde,xlab=xlab,ylab=ylab,main="All")
    
    plotDiagram("PeceTaylor",FALSE,TRUE)
    figUser(xlim=c(55,70),ylim=c(0.5,1.5))
    chullAll(border="darkgray")
    
    chullAll(border="gray",fill=TRUE)
    contourAll(cont.levels=c(0.9,0.5,0.1),border="darkblue",fade.away=FALSE,lty="dashed")

[Package GCDkit version 6.1 Index]