Re: [R] ggplot2 boxplot confusion

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

Chris,

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.

Thierry




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
Belgium
tel. + 32 54/436 185
Thierry.Onkelinx_at_inbo.be
www.inbo.be

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: r-help-bounces_at_r-project.org [mailto:r-help-bounces_at_r-project.org] Namens Chris Friedl
Verzonden: donderdag 28 februari 2008 13:51 Aan: r-help_at_r-project.org
Onderwerp: Re: [R] ggplot2 boxplot confusion

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

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),
dummy
> = factor(1))
> ggplot(mydata, aes(y = VALUE, x = dummy)) + geom_boxplot(position =
> "identity") + facet_grid(SERIES ~ ID)
>
> Thierry
>
>

-- 
View this message in context:
http://www.nabble.com/ggplot2-boxplot-confusion-tp15706116p15735720.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.

______________________________________________
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 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 https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive