title: ggplot does not work if it is inside a for loop although it works outside of it
body: <p>I'm using a simple ggplot function which works fine outside a loop but not inside even if the iterative value does not interfere with the ggplot function. Why is it so ?</p>
  
  <p>Here is my code</p>
  
  <pre><code>x=1:7
  y=1:7
  df = data.frame(x=x,y=y)
  ggplot(df,aes(x,y))+geom_point()
  </code></pre>
  
  <p>It works ! But if the ggplot is inside a for loop ...</p>
  
  <pre><code>for (i in 1:5) {
     ggplot(df,aes(x,y))+geom_point()
  }
  </code></pre>
  
  <p>it doesn't work anymore, what am I missing ?</p>