ggplot2: axis markers when grouping by two variables
<p>I have a simple bar graph in ggplot, with two factor variables on the x axis:</p>

<pre><code>library(ggplot2)
dat &lt;- data.frame(group1= c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4),
                  group2= rep(1:4,4),
                  val = 1:16)

ggplot(dat, aes(x=group1,y=val,group=group2))+
  geom_bar(stat="identity", position="dodge")
</code></pre>

<p>What is the simplest way to add a second x axis label (for group2)?  There is a more complex version of this question <a href="https://stackoverflow.com/questions/10183888/how-can-i-add-second-axis-labels-in-ggplot2">here</a>, but I don't see how to apply this logic to this simple case.</p>