Here is the code:
## Slide with Plot library(patchwork) library(tidyverse) # prep frequency table freqtable <- table(mpg$manufacturer) df <- as.data.frame.table(freqtable) head(df) theme_set(theme_classic()) # Plot g <- ggplot(df, aes(Var1, Freq)) g <- g + geom_bar(stat="identity", width = 0.5, fill="tomato2") + theme(axis.text.x = element_text(angle=65, vjust=0.6)) + theme(axis.title.x = element_blank()) g+g+g+g
This produces 2 slides. I have 2 questions:
How do I prevent the first slide from being produced so that only the plot slide is created?
How do I change the dimensions/size of the plot? I am using Patchwork to create a 4x4 plot which I want to save to a PowerPoint slide. The code above successfully creates the 4x4 plots but when I execute the above Markdown program, the plot is too small on the powerpoint slide. I have tried the fig.width and fig.height options and a few other suggested methods but none of them appear to affect the size of the plot in PowerPoint. I am also not clear on how to create a custom template - it is difficult for me to understand the directions for doing so....
Thanks for the help!