Re: [R] ggplot2 boxplot confusion

From: ONKELINX, Thierry <>
Date: Fri, 29 Feb 2008 09:36:20 +0100


I've learned those things by using R and trying to solve the problems I encounter. The dummy is nothing more than a more elegant way of using factor(1). The only connection with ggplot2, is that the plots will use the name in the dataframe or the expression. And 'dummy' looks nicer than 'factor(1)'.
I've found the position = "identity" solution by looking at the error message which pointed to position = "dodge". In this case using an alternative for the position argument solved the problem.

I'm using the same resource as you do: mainly my onw experience, the online manual and the book. In case I get really stuck I use the mailing list. I haven't used gplot.

Getting to know ggplot2 takes some time when you want to do some fancy stuff. But once you get the hang of it ggplot2 gives nice graphs without a very complex code.


ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics, methodology and quality assurance
Gaverstraat 4
9500 Geraardsbergen
tel. + 32 54/436 185

Do not put your faith in what statistics say until you have carefully considered what they do not say. ~William W. Watt A statistical analysis, properly conducted, is a delicate dissection of uncertainties, a surgery of suppositions. ~M.J.Moroney

-----Oorspronkelijk bericht-----
Van: [] Namens Chris Friedl
Verzonden: donderdag 28 februari 2008 13:51 Aan:
Onderwerp: Re: [R] ggplot2 boxplot confusion

Hey thanks Thierry! I learned two things here ... position="identity" AND

Can I ask where you learned these things. I've read a lot of the online reference manual, "the book", other presentations of ggplot2 and don't recall seeing these, especially the x=dummy reference.

Does this come from experience with the previous gplot package? Perhaps I
should use that too?

ONKELINX, Thierry wrote:
> Chris,
> You need to specify position = "identity"
> library(ggplot2)
> series <- c('C2','C4','C8','C10','C15','C20')
> series <- factor(series, levels = series)
> ids <- c('ID1','ID2','ID3')
> mydata <-
> data.frame(SERIES=rep(series,30),ID=rep(ids,60),VALUE=rnorm(180),
> = factor(1))
> ggplot(mydata, aes(y = VALUE, x = dummy)) + geom_boxplot(position =
> "identity") + facet_grid(SERIES ~ ID)
> Thierry

View this message in context:
Sent from the R help mailing list archive at

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 29 Feb 2008 - 08:38:15 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 29 Feb 2008 - 09:30:17 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive