On Thu, Oct 30, 2008 at 4:10 PM, Barker, Chris <[EMAIL PROTECTED]> wrote:
>
>
>  I am using the lattice histogram
>
> histogram( ~ base_var   | treatment, data=mydataset )
>
>  In my dataset, the histogram produces (as expected) two histograms,
> each corresponding to one of the two treatments.
>
>  I would like to have the histogram for one treatment to have, say,  red
> bars, the histogram for the second treatment,  to have blue bars.
>
> I tried the ",col=" option, but that colors individual bars rather than
> the histogram.

Try

histogram(~ base_var   | treatment, data=mydataset
    panel = function(..., col) panel.histogram(..., col = c('red',
'blue')[packet.number()]))

-Deepayan

______________________________________________
R-help@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.

Reply via email to