Re: [R] ggplot2 - Problem with grid plot

2008-03-04 Thread Chris Friedl
ONKELINX, Thierry wrote: > > Dear Chris, > > You'll need to add information on the facet factor (color) to the > medians dataset. > > library(ggplot2) > medians <- aggregate(diamonds$price, list(cut = diamonds$cut, color = > diamonds$color), median) > ggplot(data=diamonds, aes(x=price)) + geo

Re: [R] ggplot2 - Problem with grid plot

2008-03-04 Thread hadley wickham
On Tue, Mar 4, 2008 at 6:41 AM, ONKELINX, Thierry <[EMAIL PROTECTED]> wrote: > Dear Chris, > > You'll need to add information on the facet factor (color) to the > medians dataset. > > library(ggplot2) > medians <- aggregate(diamonds$price, list(cut = diamonds$cut, color = > diamonds$color), me

Re: [R] ggplot2 - Problem with grid plot

2008-03-04 Thread ONKELINX, Thierry
ggplot2 - Problem with grid plot Hi R-help I'm trying to create a grid plot in which each plot in the grid contains two density plots (colored by factor) and two vertical lines at the respective medians (also colored by the factor). Using the diamonds dataset as an example, the following commands

[R] ggplot2 - Problem with grid plot

2008-03-04 Thread Chris Friedl
Hi R-help I'm trying to create a grid plot in which each plot in the grid contains two density plots (colored by factor) and two vertical lines at the respective medians (also colored by the factor). Using the diamonds dataset as an example, the following commands give me price density plots by