在ggplot2中的特定构面之间添加空间(facet_grid)

Emi*_*ily 5 r ggplot2

我已经能够在所有构面之间添加垂直间隔(仅改变构面之间的水平间隔(ggplot2)),但是还无法在指定的构面之间仅添加一个间隔吗?

这是一个基于我的真实数据的示例(在真实情节中,我堆积了条形图):

mydf<-data.frame(year = rep(c(2016,2016,2016,2016,2016,2016,2017,2017,2017,2017,2017,2017),times = 2),
             Area = rep(c('here','there'),times = 12),
             yearArea = rep(c('here.2016','here.2017', 'there.2016','there.2017'), times = 12),
             treatment = rep(c('control','control','control','treat', 'treat','treat'), times = 4),
             response = rep(c('a','b','c','d'), times = 6),
             count = rep(c(23,15,30,20), times = 6))
mycolour<-c("#999999", "#0072B2", "#009E73","#000000")
Run Code Online (Sandbox Code Playgroud)

返回图:

#default facet spacing 
example<-ggplot(data=mydf, aes(x=treatment, y=count, fill=response)) + 
  geom_bar(stat="identity", width = 0.5) +  
  scale_fill_manual(values = mycolour, name = "Response") + 
  labs (y = "Count") +
  facet_grid(~yearArea) + 
  theme_bw()
example

#spacing between each facet
spacedex<-example + theme(panel.spacing.x=unit(2, "lines"))

spacedex
Run Code Online (Sandbox Code Playgroud)

如何将空间的增加限制为仅在第二和第三方面之间?(在here.2017和there.2016之间)