[R] levelplot in lattice

Deepayan Sarkar deepayan.sarkar at gmail.com
Thu Jun 28 02:00:17 CEST 2007


On 6/27/07, adschai at optonline.net <adschai at optonline.net> wrote:
> Hi,
>
> I'm new to lattice. So please kindly be patient with me.
> I'm trying to arrange groups of levelplots into 3 rows as follows:
>
> Row1: Probabilities as functions of x and y, and conditioned on an event factor vector factor("a","b","c")
>
> Row2: Number of days as functions of  x and y, and conditioned on, again the same event factor("a","b","c")
>
> Row2: Costs as functions of  x and y, and conditioned on, again the same event factor("a","b","c")
>
> I tried the following:
>
> windows();
> par(mfrow=c(3,1));
> levelplot(z ~ x*y|events, probDat);
> levelplot(z ~ x*y|events, daysDat);
> levelplot(z ~ x*y|events, costDat);
>
> It does not do what I want. It replace the previous plot every time I call a new levelplot. I can't put them into the same matrix and plot them all at once because the scale of each data type is very different, i.e.g probability=c(0,1), days=c(0,10), etc. I'm wondering if you could suggest a way to solve this problem.
>

It all depends on the details. Please give a small reproducible example.

> Also, if I would like to put in mathematical notation on the top strip of the plot instead of using text in my events factor vector, what can I do?

Use expressions (see ?plotmath). Again, please give details.

-Deepayan



More information about the R-help mailing list