if (FALSE) { # interactive()
# create toy plots: 2 png's and 1 jpeg
dir.create("toy_plots")
png("toy_plots/plot1.png"); plot(rnorm(100)); dev.off()
png("toy_plots/plot2.png"); plot(hist(rnorm(100))); dev.off()
png("toy_plots/plot3.jpeg"); plot(hclust(dist(USArrests), "ave")); dev.off()
# upload only the two png's
cloud_local_ls("toy_plots") |>
dplyr::filter(type == "png") |>
cloud_s3_upload_bulk()
# clean up
unlink("toy_plots", recursive = TRUE)
}
Run the code above in your browser using DataLab