[R] ggplot with sparse layout

ONKELINX, Thierry Thierry.ONKELINX at inbo.be
Tue Jan 6 23:58:07 CET 2015

Dear Tom,

Does ggplot(data,aes(x=x,y=y))+geom_point(aes(color=group))+facet_wrap(~group + id) gives what you need?

Note that facet_grid by design aligns the subplots into rows and columns with the same level.

Best regards,

ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
+ 32 2 525 02 51
+ 32 54 43 61 85
Thierry.Onkelinx op inbo.be
To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey

Van: R-help [r-help-bounces op r-project.org] namens Tom Wright [tom op maladmin.com]
Verzonden: dinsdag 6 januari 2015 22:13
Aan: R. Help
Onderwerp: [R] ggplot with sparse layout


I would like to plot the following data such that each plot represents the
data from a single id and the plots are grouped according to the group


The following ggplot nearly works but I would prefer to not plot the
missing combinations, i.e. each row will be a different length.


Is this possible using ggplot or will I need to craft something using grid?

Thanks for any ideas.

        [[alternative HTML version deleted]]

R-help op r-project.org mailing list -- To UNSUBSCRIBE and more, see
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