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 PS: My first attempt to send this message bounced back - I hope you don't see this twice; otherwise, mea culpa. -- View this message in context: http://www.nabble.com/Lattice%3A-Superpose-bwplot-and-dotplot--newbie-question--tp17873822p17873822.html Sent from the R help mailing list archive at Nabble.com.
Stephen Weigand
2008-Jun-16 22:37 UTC
[R] Lattice: Superpose bwplot and dotplot [newbie question]
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! > LYHow 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
Stephen D. Weigand wrote:> > > 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 = "|", ...) > }) >Thanks - that helped! After I realized that for my example, only the first x and y are replaced by my own variables (and not in the panel calls), it worked great! -- View this message in context: http://www.nabble.com/Lattice%3A-Superpose-bwplot-and-dotplot--newbie-question--tp17873822p17879641.html Sent from the R help mailing list archive at Nabble.com.