Re: [R] barplot as Trellis graphic

From: hadley wickham <h.wickham_at_gmail.com>
Date: Fri, 28 Mar 2008 06:58:31 -0500

On Fri, Mar 28, 2008 at 1:42 AM, Agustin Lobo <Agustin.Lobo_at_ija.csic.es> wrote:
> Thanks for your detailed explanation.
> You are right, a set of boxplots done with bwplot
> is a much better graphic for this type of data:
>
> bwplot(V1~VAR|f,data=datos2)
>
> This was not a good example. The barplot would be suited
> for counts, ie. species composition:
> datos4 <-
> data.frame(V1=round(runif(200,1,5)),SITE=factor(round(runif(200,1,3))))

The bar plot in ggplot2 (http://had.co.nz/ggplot2) automatically aggregates your data:

install.packages("ggplot2")
library(ggplot2)

qplot(factor(V1), data=datos4, geom="bar", facets = . ~ SITE)

> Is there an R guide to Trellis graphics?

How about http://www.amazon.com/dp/0387759689 ?

Hadley

-- 
http://had.co.nz/

______________________________________________
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 Fri 28 Mar 2008 - 12:01:34 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 Fri 28 Mar 2008 - 12:30:25 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