# \donttest{
if(requireNamespace("ggplot2", quietly = TRUE)){
library(ggplot2)
data(iris)
g <- ggplot(iris, aes(Sepal.Width, Sepal.Length, color = Species))
g <- g + geom_point(size = 4)
file_path <- tempfile(fileext = ".png")
ggsave(file_path, plot = g)
unlink(file_path) # Eliminar el archivo temporal
}
# }
Run the code above in your browser using DataLab