Learn R Programming

adegraphics (version 1.0-3)

adeg.panel.values: Panel function drawing a third variable into a two-dimensional scatterplot

Description

Panel function for drawing coordinates with variable representation. The values can be represented through symbols with proportional size or various colors.

Usage

adeg.panel.values(x, y, z, method, symbol, ppoints, breaks, centerpar = NULL, 
  center = 0)

Arguments

x
a numeric vector, x-coordinates for the symbols
y
a numeric vector, y-coordinates for the symbols
z
a numeric vector, the third variable with one value per coordinates (x, y)
method
a character string equal to color or size. If color, a palette of color is used for the symbols (one color per interval defined by breaks). If size, symbols' area is proportional to the valu
symbol
a character string equal to square or circle.
ppoints
a list of parameters as an extract of adegpar("ppoints"), used for points' drawing.
  • alpha: transparency of points
cex: size of points col: border colo

Value

  • Draws the points.

item

  • breaks
  • centerpar
  • center

code

size

References

Tanimura, S. and Kuroiwa, C. and Mizota, T. 2006 Proportional symbol mapping in R Journal of Statistical Software 15, 1--7

Examples

Run this code
if(require(lattice, quiet = TRUE)) {
param <- adegpar("ppoints")[[1]]
param$col <- adegpar("ppalette")[[1L]]$quanti(2)
z <- rnorm(10)
xyplot(1:10 ~ 1:10, panel = function(x, y, ...){
  adeg.panel.values(x, y, z, method = "size", symbol = "square", ppoints =
  param, breaks = pretty(z, 4))})

param$col <- adegpar()$ppalette$quali((length(pretty(z, 2)) - 1))
xyplot(1:10 ~ 1:10, panel = function(x, y, ...){
  adeg.panel.values(x, y, z, method = "color", symbol = "circle", 
                    ppoints = param, breaks = pretty(z, 2))}) 
}

Run the code above in your browser using DataLab