title: How to save plots inside a folder?
body: <p>This is such a basic question, but I am not able to find an answer to it.</p>
  
  <p>All I want to do is to store all figures to a folder one directory inside where the R script is stored. And I don't want to use full dir, but relative directory, as I work from multiple computers.</p>
  
  <p>So, I have this structure:</p>
  
  <pre><code>/code
    /Rscript1
    /inputdata
    /Rscript2 
        /figs
            fig1
            fig2
  </code></pre>
  
  <p>All I want to do is tell ggplot to store all figures inside <strong>"figs"</strong> folder instead of the same folder as Rscript1 and Rscript2 (i.e. <strong>"code"</strong> folder).</p>
  
  <pre><code>scatter&lt;-function(df,x,y){
    ggplot(df, aes_string(x=x, y=y)) +
      geom_point()+
      theme_bw()+
      theme(panel.grid.major = element_line(colour = "#808080"))
  }
  
  scatter(df=dassmp,x='Oss',y='sa')+
    ggsave('fig1.png',width=6, height=4,dpi=300)
  </code></pre>