I plot a simple linear regression using R. I would like to save that image as PNG or JPEG, is it possible to do it automatically? (via code)
There are two different
If you use R Studio http://rstudio.org/ there is a special menu to save you plot as any format you like and at any resolution you choose