Gallery.rpy Direct
# Load necessary libraries library(ggplot2) library(gridExtra)
# Create a first plot p1 <- ggplot(mtcars, aes(x = wt, y = mpg)) + geom_point() + labs(title = "Scatterplot of MPG vs. WT") gallery.rpy
# Create a second plot p2 <- ggplot(mtcars, aes(x = cyl, y = mpg)) + geom_bar(stat = "identity") + labs(title = "Barplot of Cylinders vs. MPG") aes(x = wt
install.packages("ggplot2") Now, let's create a simple gallery: aes(x = cyl
First, ensure you have ggplot2 installed: