# a plot save to file.path(getwd(), "1.png")
plot(rnorm(100))
savePNG(getwd(), n = 1)
# a sequence of plots saved in the work directory
# this is just how animations are produced
for(i in 1:10){
plot(rnorm(1), rnorm(1), xlim = c(-1, 1), ylim = c(-1, 1))
savePNG(getwd(), n = i)
}
# you might need file.remove(paste(1:10, ".png", sep = ""))
Run the code above in your browser using DataLab