contourAll {GCDkit} | R Documentation |
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.
chullAll(border=NULL, fill=FALSE, ...) contourAll(cont.levels = c(0.25,0.50,0.75), n = 20, border = NULL, fill = FALSE, fade.away = TRUE,...)
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. |
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
.
Returns (invisibly) a list with two components:
z |
Values of estimated densities for each of the |
kde |
A matrix of the estimated density: rows correspond to the value of |
Vojtěch Janoušek, vojtech.janousek@geology.cz and
Jean-François Moyen jfmoyen@gmail.com
chull, optimize kde2d contour, polygon figaro contourGroups chullGroups plotDiagram
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")