Re: [R] plotting grouped data object

From: Afshartous, David <afshart_at_exchange.sba.miami.edu>
Date: Mon 25 Sep 2006 - 20:06:33 GMT


thanks!

-----Original Message-----
From: Deepayan Sarkar [mailto:deepayan.sarkar@gmail.com] Sent: Monday, September 25, 2006 1:34 PM To: Afshartous, David
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] plotting grouped data object

On 9/23/06, Afshartous, David <afshart@exchange.sba.miami.edu> wrote:
>
> All,
> I'd like to plot the main relationship of a grouped data object for
> all levels of a factor in a single panel.
> The sample code below creates a separate panel for each level of the
> factor. I realize that this could be done in other ways, but I'd like

> to do it via plotting the grouped data object.
> thanks!
> dave
>
> z = rnorm(18, mean=0, sd=1)
> x = rep(1:6, 3)
> y = factor(rep(c("I", "C", "P"), each = 6)) dat = data.frame(x, y, z)
> data.grp = groupedData(z ~ x | y, data = dat) plot(data.grp, outer = ~

> y) ### this produces 1 line each in 3 panels ### how to collapse all 3

> lines into 1 panel?

The closest I can get is

dat$one <- gl(1, 18)
data.grp = groupedData(z ~ x | one, data = dat) plot(data.grp, innerGroups = ~y, strip = FALSE)

-Deepayan



R-help@stat.math.ethz.ch 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 Tue Sep 26 06:09:49 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 25 Sep 2006 - 21:30:08 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.