panel.quadrants | R Documentation |
This panel function allows to draw custom quadrants and display additional quadrant statistics as often used in biomedical sciences. Grouping is ignored.
panel.quadrants(
x,
y,
h = NULL,
v = NULL,
labels = "percent",
col = grey(0.5),
margin = 0.1,
lwd = trellis.par.get()$superpose.polygon$lwd[1],
na.rm = FALSE,
...
)
x, y |
(numeric) variables to be plotted |
h, v |
(numeric) position of the horizontal or vertical threshold for dividing the data into quadarants. Defaults to the median. |
labels |
(character) One of 'percent', 'events', or 'none'. Controls what type of summary is plottted per quadrant |
col, lwd |
graphical parameters for lines and labels |
margin |
(numeric) margin of labels to the plot edges in Normalised Parent Coordinates, default is 0.1 |
na.rm |
(logical) Should NA or Inf values be removed automatically? Default is FAlSE |
... |
other arguments passed to the function |
library(lattice)
data(mtcars)
# Default behavior for quadrants is to split x and y data
# at the respective median, and plot percentage of points
# per quandrant
xyplot(mpg ~ 1/wt | factor(vs), mtcars,
groups = carb, pch = 19, cex = 1,
panel = function(x, y, ...) {
panel.xyplot(x, y, ...)
panel.quadrants(x, y, ...)
}
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.