I am trying to perform a gradual reveal or build of the bars in my plot within an Rstudio ioslides presentation. 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? It is important that I maintain all spacing of text and bars across the two slides.
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.
library(tidyverse)
mtcars %>%
mutate(
am = factor(am, labels = c("auto", "manual")),
vs = factor(vs, labels = c("V", "S"))
) %>%
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")
)