[R] series of boxplots

Juliet Hannah juliet.hannah at gmail.com
Fri Feb 11 18:28:26 CET 2011


If you could provide a small example of an actual data set (using
dput), you may get some suggestions
specific to your goals.

Here are a few examples of boxplots. If these look along the lines of
what you are looking for, you may want to search
the ggplot2 mailing list for more examples.

library(ggplot2)
qplot(factor(cyl), mpg, data=mtcars, geom="boxplot")

# example 2

mydata <- data.frame( group1=
sample(c("C","D"),size=100,replace=TRUE),
group2=sample(c("E","F"),size=100,replace=TRUE),  y=rnorm(100))

qplot(group2, y, data=mydata, facets = ~ group1,  geom="boxplot")

On Mon, Feb 7, 2011 at 6:16 AM, syrvn <mentor_ at gmx.net> wrote:
>
> hi group,
>
> imagine the following data frame df:
>
> 1 2 3 4 ...
> A 5 1 ..
> A 4 3 ..
> A 3 4 ..
> B 7 9 ..
> B 8 1 ..
> B 6 8 ..
>
> I tried the following and some variations to plot this matrix as boxplots:
>
>
> boxplot(df[1:3,2]~df[1:3,1], xlim=c(1,10))
> par(new=TRUE)
> boxplot(cpd12[4:6,2]~df[1:3,1], xlim=c(2,10))
> par(new=TRUE)
> boxplot(df[1:3,3]~df[1:3,1], xlim=c(1,10))
> par(new=TRUE)
> boxplot(cpd12[4:6,3]~df[1:3,1], xlim=c(2,10))
>
>
> can anybody help?
> Cheers
> --
> View this message in context: http://r.789695.n4.nabble.com/series-of-boxplots-tp3263938p3263938.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>



More information about the R-help mailing list