[R] barplot as Trellis graphic
hadley wickham
h.wickham at gmail.com
Fri Mar 28 12:58:31 CET 2008
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/
More information about the R-help
mailing list