Another method uses the core boxplot() function but replaces the usual call to split() with a variant that puts all the data at the end of the list of splits:
> splitPlusAll <- function(x, ...) c(split(x, ...), list(All=x)) > boxplot(with(mtcars, splitPlusAll(wt, list(gear,am), drop=TRUE))) > boxplot(with(mtcars, split(wt, list(gear,am), drop=TRUE))) (It helps if you show what you have done when your question arose, as there are several R functions for drawing boxplots.) Bill Dunlap TIBCO Software wdunlap tibco.com On Mon, May 19, 2014 at 2:41 PM, Shane Carey <careys...@gmail.com> wrote: > Great, > > Thanks everyone :-) > > On Monday, May 19, 2014, Richard M. Heiberger <r...@temple.edu> wrote: > >> tmp <- data.frame(y=c(rnorm(20), rnorm(20), c=rnorm(20)), >> g=rep(letters[1:3], each=20)) >> >> library(lattice) >> library(latticeExtra) >> A <- bwplot(y ~ g, data=tmp) >> B <- bwplot(y ~ rep("Y",60), data=tmp, horizontal=FALSE) >> >> resizePanels(c(Individual=A, "All Together"=B, layout=c(2,1)), w=c(3,1)) >> >> >> ## for even more options, you can look at the examples in >> ## the HH package >> ## install.packages("HH") ## if necessary >> library(HH) >> demo("bwplot.examples", package="HH") >> example("panel.bwplot.superpose", package="HH") >> ?panel.bwplot.intermediate.hh >> ?panel.bwplot.superpose >> >> On Mon, May 19, 2014 at 10:08 AM, Shane Carey >> <careys...@gmail.com<javascript:;>> >> wrote: >> > Hi, >> > >> > I have boxplots by factors for a dataset and trying to include a boxplot >> to >> > represent the entire dataset. >> > >> > Any idea how this would be done? >> > >> > Thanks >> > >> > -- >> > Shane >> > >> > [[alternative HTML version deleted]] >> > >> > ______________________________________________ >> > R-help@r-project.org <javascript:;> 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. >> > > > -- > Shane > > [[alternative HTML version deleted]] > > ______________________________________________ > 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. ______________________________________________ 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.