Message-ID: <CAGx1TMDi_F_0D7DZ_+4GUK_UV23jzVGyB0f6ko6BA0yM1gSYBg@mail.gmail.com>
Date: 2012-09-06T18:40:29Z
From: Richard M. Heiberger
Subject: Lattice bwplot(): Changing Orientation of Plots in Multipanel Display
In-Reply-To: <alpine.LNX.2.00.1209061056180.21319@salmo.appl-ecosys.com>
The primary recommendation is to use the "y ~ x" formula rather than
the "~ y | x"
formula. The place to look first is in the help files
?bwplot
?panel.bwplot
Here is a example that matches your data structure
Rich
tmp <- data.frame(y=rnorm(20),
x=rep(letters[1:2], each=10))
bwplot(y ~ x, data=tmp)
bwplot(x ~ y, data=tmp)
## slightly longer, and illustrating the
## horizontal= and xlab= and ylab= arguments
bwplot(y ~ x, data=tmp, horizontal=FALSE, xlab="group")
bwplot(x ~ y, data=tmp, horizontal=TRUE, ylab="group")
On 9/6/12, Rich Shepard <rshepard at appl-ecosys.com> wrote:
> I've looked again at Deepayan Sakar's 'Lattice' book and not seeing the
> information I know must be in there. A clue stick would be much
> appreciated.
>
> A pair of box-and-whisker plots for two conditions of the same data set
> display each box plot horizontally (see attached pH figure). Relations of
> the two are not as easily seen as they would be if the two panels had the
> plots oriented vertically. Alternatively, the panels could be oriented
> horizontally so the two plots could be visually compared more easily.
>
> The command I used to produce the attached figure is:
>
> bwplot( ~ pH | era, data = chem.cast, main = 'pH', xlab = 'Standard Units')
>
> What do I add to this to change the plot orientations to vertical? And,
> where in the book are the details discussed?
>
> TIA,
>
> Rich
>