[R-sig-ME] how to group x-axis levels with ggplot()

Luca Danieli mr@luced@n @ending from hotm@il@it
Mon Sep 10 15:03:44 CEST 2018


Hello everybody,

I have tried to solve this issue by posting a question on StackOverflow, but got no responses:
https://stackoverflow.com/questions/52225595/r-ggplot-how-to-group-levels-in-a-plots-axis-in-order-to-represent-a-cont

Basically, I have a plot (ggplot) of my lmer() model that presents on the x axis 8 levels. As my contrast splits these 8 levels in two groups (1 and 2 together, contrasted to 3,4,5,6,7,8 altogether), I would like to plot the results by grouping the 8 levels of the x axis into the two groups of the contrast hypothesis.

So, instead of:

^
| val  val  val  val  val  val  val  val
|-1----2---3----4---5----6----7---8  ----------> x axis

to have

^
| val                   val
|-front (1+2)---back+sides (3+4+5+6+7+8) -------------> x axis

Is it possible to do such a thing?
In case it was not possible to plot by grouping the x-axis levels through the ggplot() function, would it be the same if I grouped the levels before analyzing the model, in order to plot it as wished?

Best
Luca




	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list