# Create a scatter plot for mpg vs. wt
plot(mtcars$wt, mtcars$mpg,
xlab = "Weight (x1000 lbs)",
ylab = "Miles per Gallon",
main = "Scatter Plot of Weight vs. MPG",
col = "blue")

barplot(table(mtcars$cyl),
main = "Bar Graph of Cylinders in mtcars Dataset",
xlab = "Number of Cylinders",
ylab = "Frequency",
col = "blue")

library(ggplot2)
library(gganimate)
data(trees)
trees$index <- seq(nrow(trees))
p <- ggplot(trees, aes(Girth, Height, size = Volume, color = Volume)) +
geom_point() +
labs(title = "Animated Plot of Tree Data") +
transition_time(index) +
shadow_wake(wake_length = 0.5)
animate(p)
