title: unable to start png() device for plot names create with "paste" function
body: <p>I was trying to plot a series of scatterplots with different sets of variables.  In doing so, I use "paste" to combine two (or more) variable names as </p>
  
  <pre><code>plot.name &lt;- paste(paste("var1.name", "var2.name",..., sep="_"), "plot.png", sep=" ")
  </code></pre>
  
  <p>Then I use this name in "ggsave" as</p>
  
  <pre><code>ggsave(plot.name, width=7.5, height=5, units="in", dpi=300)
  </code></pre>
  
  <p>Each time I tried I get </p>
  
  <pre><code>Error in grDevices::png(..., res = dpi, units = "in") : unable to start png() device 
  In addition: Warning messages:
  1: In grDevices::png(..., res = dpi, units = "in") : unable to open file 'plot.name'
  2: In grDevices::png(..., res = dpi, units = "in") : opening device failed
  </code></pre>
  
  <p>This only happens when I use a plot name created with "paste" containing 2 or more variable names but it does not happen if I use just "plot.png" or a single thread of character ("xxx xxx xxx xxx.png"). This happens with all types of devices (jpg, etc.). Does anyone have any idea why a simple name works but not a name created by "paste" does not to save images?  This was never the issue before but it started happening when I tried to use Rstudio. I normally write all codes in Tinn-R then export them to R.</p>
  
  <p>The followings are more details. </p>
  
  <p>Names of 4 variables are;</p>
  
  <pre><code>x.var.actual.name.list &lt;-                           
       c("Elev.Nov.Prev.2.mo", "Sal.Fall", "ArtBio.Sep.Prev", "min.temp.Sep.Prev.2.mo")
  </code></pre>
  
  <p>An input dataframe is:</p>
  
  <pre><code>df.in &lt;- combined.df[,c(y.var, x.var.actual.name.list)]
  
        Total Elev.Nov.Prev.2.mo Sal.Fall ArtBio.Sep.Prev min.temp.Sep.Prev.2.mo
        10.158711      6381.35   83.05407    17.143527    48.27
        10.684462      6381.00   83.64119    22.075855    49.38
        10.849221      6380.30   84.70405    26.175721    46.06
        10.021848      6381.55   82.23643    20.024815    47.19
        10.019090      6384.15   77.78226    17.459871    47.13
        10.171566      6382.55   80.97417    21.180415    49.33
        ...
  </code></pre>
  
  <p>For instance I use "ggcorr" from GGally package to plot correlation matrix;</p>
  
  <pre><code>require(GGally)        
  cor.scatter.png.file &lt;- paste(paste(x.var.actual.name.list, collapse=" "),
                          "correlation scatter plot matrix.png", sep=" ")    
  cor.mat.plot &lt;- ggcorr(df.in,2, palette = "RdYlGn", name = "r",label = T,                      
                  label_color = "black", label_round = 2)
  
  ggsave(cor.scatter.png.file, width=7.5, height=5, units="in")      
  </code></pre>
  
  <p>Above scrips result in an error;</p>
  
  <pre><code>Error in grDevices::png(..., res = dpi, units = "in") :                
  unable to start png() device
  In addition: Warning messages:
  1: In grDevices::png(..., res = dpi, units = "in") :
  unable to open file 'Elev.Nov.Prev.2.mo Sal.Fall ArtBio.Sep.Prev 
  min.temp.Sep.Prev.2.mo correlation scatter plot matrix.png' for writing
  2: In grDevices::png(..., res = dpi, units = "in") : opening device failed
  </code></pre>
  
  <p>But if I do the following (not using a pasted part of the name) it works.</p>
  
  <pre><code>ggsave("correlation scatter plot matrix.png", width=7.5, height=5, units="in")
  </code></pre>
  
  <p>The first script with a pasted name worked before, but stopped working after I tried to run the same script in Rstudio. Now anytime I use pasted names R returns the error message. I have uninstalled Rstudio and R and reinstalled R but the same issue persists. I appreciate any suggestions to fix this problem.</p>