title: Gradually reveal bars of barplot in ioslides
body: <p>I am trying to perform a gradual reveal or build of the bars in my plot within an Rstudio ioslides presentation. <strong>How might I display the plot below while hiding the 3rd and 4th bars in one slide before showing the full plot in the next slide?</strong> It is important that I maintain all spacing of text and bars across the two slides. </p>
  
  <p>I find this technique useful in presentations, but can only do this currently in powerpoint/keynote by placing a white box over the bars I wish to hide.  </p>
  
  <pre><code>library(tidyverse)
  
  mtcars %&gt;% 
    mutate(
      am = factor(am, labels = c("auto", "manual")),
      vs = factor(vs, labels = c("V", "S"))
    ) %&gt;% 
    ggplot(aes(x = am, y = mpg, fill = vs)) + 
    geom_col(position = position_dodge()) +
    theme(
      panel.grid.minor = element_blank(),
      panel.grid.major = element_blank(),
      panel.background = element_blank(), 
      panel.border = element_blank(),
      axis.line = element_line(colour = "black")
    )
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/8wYSV.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8wYSV.jpg" alt="plot displaying 2 bars"></a>
  <a href="https://i.stack.imgur.com/nhTxm.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nhTxm.jpg" alt="plot displaying all bars"></a></p>