I have been using ggsave for years with no problem. But now it suddenly stopped saving plots. It saves an empty png. Here's an example (very primitive to show that the problem is not in the plot itself):
col2=brewer.pal(n=11, name = "Spectral")
barplot((1:11), col=col2)
ggsave("plot1.png")
The plot appears in Rstudio but not in the saved figure. I recently updated Rstudio ("Ghost Orchid" Release (077589bc, 2021-09-20)) and R (4.1.1 (2021-08-10) -- "Kick Things"). What could be the problem?
Thanks!