title: Error in dev.off() : cannot shut down device 1 (the null device)
body: <p>I am new to R programming and I got hit with this error when I tried to run the code. This simply creates a pie chart with some data. Can anyone explain to me why I am getting this error and what it means?</p>
  
  <p>1) I am running windows
  2) Version 3.4.0
  3) I am using RGui desktop
  4) R version 3.4.0</p>
  
  <pre><code># Create data for the graph.
  x &lt;- c(21, 62, 10, 53)
  labels &lt;- c("London", "New York", "Singapore", "Mumbai")
  
  # Give the chart file a name.
  png(file = "city_title_colours.jpg")
  
  # Plot the chart with title and rainbow color pallet.
  pie(x, labels, main = "City pie chart", col = rainbow(length(x)))
  
  # Save the file.
  dev.off()
  </code></pre>