simpleKey {lattice} | R Documentation

## Function to generate a simple key

### Description

Simple interface to generate a list appropriate for `draw.key`

### Usage

    simpleKey(text, points = TRUE,
              rectangles = FALSE,
              lines = FALSE,
              col, cex, font,
              fontface, fontfamily, ...)

### Arguments

`text` | character or expression vector, to be used as labels for levels of the grouping variable
`points` | logical
`rectangles` | logical
`lines` | logical
`col, cex, font, fontface, fontfamily` | Used as top-level components of the list produced, to be used for the text labels. Defaults to the values in `trellis.par.get("add.text")`
`...` | further arguments added to the list, eventually passed to `draw.key`

### Details

A lattice plot can include a legend (key) if an appropriate list is specified as the `key` argument to a high level Lattice function such as `xyplot`. This key can be very flexible, but that flexibility comes at the cost of this list being very complicated even in simple situations. The `simpleKey` function is a shortcut, which assumes that the key is being drawn in conjunction with the `groups` argument, and that the default Trellis settings are being used. At most one each of points, rectangles and lines can be drawn.

See also the `auto.key` argument for high level plots.

### Value

A list that would work as the `key` argument to `xyplot` etc.

### Author(s)

Deepayan Sarkar Deepayan.Sarkar@R-project.org

### See Also

`draw.key`, `xyplot`, `Lattice`

[Package lattice version 0.11-8 Index]