I am trying to reorder my facet's x axis, but I'm not sure how to write an optional level for it, since some of the subgroups have "A" and others "B" and some both and if i write both of them, all the facet subgroups have two of them, some leaving one blank. I thought i could use operators |
and &
in between "A" and "B", but it didn't work.
My minimal dataset:
df_full<-data.frame(Treatment=c(A, B, 1,10,100,1, 10,100,1, 10, 100),
mean=c(0.4901950, 0.4360639, 0.9008428,0.8278645,0.7890388,0.9541905,
0.8537885,0.8212504,1.3828724,0.7165685, 0.7985398),
vector=c("G", "F", "A","B","C","D", "E", "F","G","A", "B"),
upper =c(0.9046951, 0.9046951, 1.0990144, 0.9505348, 0.8273494, 1.0389074, 0.9227461, 0.9657371, 1.6864420, 0.7401891, 0.9046951),
lower=c(0.9528077, 0.6923846, 0.7026713, 0.7051941, 0.7507282, 0.9528077, 0.7848309, 0.6767638, 1.0793029, 0.6929479, 0.6923846),
p.value=c(0.05, 0.04, 0.0003, 0.6500, 1,0.02,0.0400,
0.3301,0.100,0.023, 0.05))
My current facet order level code:
Treatment_factor = factor(df_full$Treatment, levels =c("A", "B", "1", "10", "100"))
ggplot(df_full, aes(x = Treatment_factor, y = mean, color = Treatment_factor, group = vector))
I attach modified picture with my current graph:
How do i add option OR and AND in my levels code?