title: How to using code to save plots in Rstudio?
body: <p>Is there any way to save the plots by code in RStudio?
  Like something in Python <code>save.plt()</code>.</p>
  
  <p>I have noticed the function <code>savePlot</code> can save the figures but I cannot load it in RStudio, since it reports the errors in loading <code>X11()</code>.</p>
  
  <p>This leads me to think about another question... What is your way to using R or what is the proper way to using R? As a beginner I found RStudio is super easy to use and I like the idea that saving all the environments into a single file. But apparently it is no need to using <code>X11()</code> in plotting...</p>