Adding conditional vertical line with x axis character
<p>I couldn't find a way to do this even looking with this similar question at here <a href="https://stackoverflow.com/questions/11093248/geom-vline-with-character-xintercept">geom-vline-with-character-xintercept</a>. </p>

<p>Basically, I try to add vertical lines to x values and vertical lines positions can be assigned with  <code>levels(theDF$YrQtr)[c(T, rep(F, 2))]</code> code.</p>

<p>but getting an error as shown below. I couldn't find out.</p>

<p>Reproducible example code;</p>

<pre><code>theGrid &lt;- expand.grid(2009:2011, 1:4)
theDF &lt;- data.frame(YrQtr=sprintf("%s Q%s", theGrid$Var1, theGrid$Var2), 
                    Minutes=c(1000, 2200, 1450, 1825, 1970, 1770, 1640, 1920, 1790, 1800, 1750, 1600))

ggplot(theDF, aes(x=YrQtr, y=Minutes)) + 
         geom_point() + 
         theme(axis.text.x=element_text(angle=90))+
geom_vline(aes(xintercept =  levels(theDF$YrQtr)[c(T, rep(F, 2))]))
</code></pre>

<blockquote>
  <p>Error: Aesthetics must be either length 1 or the same as the data (12): xintercept</p>
</blockquote>