[R] Executing an R script and show the plots.
r@dmuzom @end|ng |rom out|ook@com
Sun Jan 26 17:30:41 CET 2020
> I would like to run R scripts like that: R -f script.r and still get the
> plots that pop up.
Since you are using ggplot2, you can use the ggsave function from the package to save the plot to a location of your choice. I tested the following script from the command line and it worked.
ggplot(midwest, aes(x=area, y=poptotal)) + geom_point()
ggsave(paste0(getwd(), "/midwest.png"), device = "png")
More information about the R-help