View source: R/corrgram_levelplot.R
| levelplot_panel.ellipse | R Documentation |
These functions provide custom panel methods for lattice::levelplot().
levelplot_panel.ellipse(
x,
y,
z,
subscripts,
at,
level = 0.9,
label = FALSE,
...
)
levelplot_panel.pie(x, y, z, subscripts, at = pretty(z), scale = 0.9, ...)
x |
Numeric coordinates from levelplot. |
y |
Numeric coordinates from levelplot. |
z |
Correlation values from levelplot. |
subscripts |
Subscripts for lattice panel. (not used) |
at |
Breaks for color levels. |
level |
Confidence level for ellipse (default 0.9). |
label |
Logical; if TRUE, show correlation values as text. |
... |
Additional arguments passed to panel functions. |
scale |
Numeric; scaling factor for pie size (default 0.8). |
levelplot_panel.ellipse Draws ellipses representing correlation coefficients
in the upper triangle of a matrix. Optionally adds numeric labels in the
lower triangle.
levelplot_panel.pie Draws pie glyphs representing correlation coefficients,
omitting the diagonal.
library(lattice)
levelplot(vote, at = do.breaks(c(-1.01, 1.01), 20),
xlab = NULL, ylab = NULL, colorkey = list(space = "top"),
scales = list(x = list(rot = 90)),
panel = levelplot_panel.ellipse, label = TRUE)
levelplot(vote, at = do.breaks(c(-1.01, 1.01), 20),
xlab = NULL, ylab = NULL, colorkey = list(space = "top"),
scales = list(x = list(rot = 90)),
panel = levelplot_panel.pie, label = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.