Re: [R] Lattice: Superpose bwplot and dotplot [newbie question]

From: Stephen Weigand <weigand.stephen_at_gmail.com>
Date: Mon, 16 Jun 2008 17:37:45 -0500

On Mon, Jun 16, 2008 at 4:40 PM, Lord Yo <nabble_at_sporez.com> wrote:
>
> Hello everyone
>
> I have dataset containing a monetary value (ABS) and two factors (Fct,
> Group). I am able to create useful using:
>
> bwplot(ABS~Group|Fct)
> and
> dotplot(ABS~Group|Fct)
>
> Question: What do I have to do to overlay the dotplot with the bwplot (same
> data set)?
>
> I've found a couple of posts that hinted at the possibility of doing that,
> and checked the panel.superpose() help, but the info was too complex for my
> newbie brain.
>
> Thanks for your help!
> LY

How about:

y <- rnorm(100)
g <- factor(sample(c("g1", "g2"), size = 100, replace = TRUE))
x <- factor(sample(c("A", "B"), size = 100, replace = TRUE))
bwplot(g ~ y | x,
       panel = function(x, y, ...) {
         panel.dotplot(x, y, ...)
         panel.bwplot(x, y, pch = "|", ...)
       })



-- 
Rochester, Minn. USA

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Mon 16 Jun 2008 - 22:43:53 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 17 Jun 2008 - 08:30:45 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive