td: Set lattice parameters for multiple groups

Description Usage Arguments Details Examples

Description

Designed to easily sets lattice parameters for multiple groups. Setting parameters before calling the lattice function allows parameters to be used consistently in the group key.

Usage

1
2
3
4
5
6
7
td(new = FALSE, col = c("#0080ff", "#ff00ff", "darkgreen", "#ff0000", "orange", "#00ff00", "brown"), lty = 1:7, lwd = 1, pch = 1:7, cex = 0.8, font = 1, fill = "transparent", col.line = col, col.symbol = col, alpha = 1, alpha.line = alpha, alpha.symbol = alpha, len = 7, long = FALSE, record = FALSE, basecol = NULL, colsets = c("plot.symbol", "plot.line", "dot.symbol", "dot.line", "cloud.3d", "box.dot"), ...)

td(plot.symbol=list(col='red',pch=17))

td(plot.symbol=list(col='red',pch=17),plot.line=list(lwd=2))

gd(n=3)

Arguments

n

in 'gd' specifies the number of distinct colours to generate to distinguish groups. 'gd' uses 'latticeExtra' to set defaults for a ggplot2-like appearance. Default is n = 4

new

If new = TRUE, open a new window, otherwise modify the existing active window, if there is one.

col
lty
lwd
pch
cex

vectors for graphical parameters for each level of the groups variable

font
fill
col.line

line colour if 'groups' not given

col.symbol

symbol colour if 'groups' not given

alpha
alpha.line
alpha.symbol

graphical parameters for superpose.line and superpose.symbol

len

extend the length of parameters by recycling to lenght 'len'

long

if TRUE generate a default combination of col, lty and pch with length 42.

record

If TRUE, set history to 'recording'. Caution: this can use a lot of memory in .GlobalEnv. Consider adding selected graphs to memory with the 'Insert' key instead.

basecol
colsets
...

use to set any trellis parameter: e.g. plot.symbol=list(cex=2,col='red'). Particular useful for the cex, col, lty, lwd, alpha, pch parameters in plot.line and plot.symbol.

Details

'td' calls 'trellis.device' and sets graphical parameters for 'superpose.line' and 'superpose.symbol'. 'td' also initializes a new trellis device with a white background if new = TRUE.

Examples

1
2
3
4
5
6
7
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

td( lty = 1:7)

td( plot.symbol = list(col = 'red', pch = 17))

gmonette/spida15 documentation built on May 17, 2019, 7:26 a.m.