[R] about xyplot in lattice

Deepayan Sarkar deepayan.sarkar at gmail.com
Sat Jan 28 07:33:14 CET 2006


On 1/27/06, Jin.Li at csiro.au <Jin.Li at csiro.au> wrote:
> Hi all,
>
>
>
> I am using xyplot (lattice) to generate a figure like Figure 4.18 in
> MASS4, but I have the following two questions (1) how to change the font
> of x(y)lab?

Something like

xyplot(...

       xlab = list("foo", font = 3),

       ...)

fontface and fontfamily may be specified in the list too, although the
documentation fails to mention this.

(2) how to plot the panels for each level of the conditional
> variable (a factor in my data set) in the order as occurred in the
> data.frame rather than in the order of the levels of the conditioning
> variable?

Not possible directly, you have to change the order somehow. The
easiest is to specify the order when creating the factor explicitly,
e.g.

newf <- factor(f, levels = unique(f))

This should work fine even if f is already a factor.

Deepayan
--
http://www.stat.wisc.edu/~deepayan/




More information about the R-help mailing list