title: How to save a plot in R in a subdirectory of the working directory
body: <p>Is it possible to save a plot in R into a subdirectory of the current working directory? I tried the following, but that doesn't work. I'm not sure how to concatenate the working directory to the file name I want. </p>
  
  <pre><code>  wd &lt;- getwd()
  
    png(filename=wd+"/img/name.png")
  
    counts &lt;- table(dnom$Variant, dnom$Time)
    barplot(counts, main="Distribution of Variant and words of time",
      xlab="Temporal nouns", col=c("paleturquoise3", "palegreen3"),
      legend = rownames(counts))
  </code></pre>
  
  <p>Also, what's the default save directory for the image export functions?</p>
  
  <p>When running David's suggestion below the error returned is:</p>
  
  <pre><code>Error in png(filename = paste0(wd, "/img/name.png")) : 
    unable to start png() device
  In addition: Warning messages:
  1: In png(filename = paste0(wd, "/img/name.png")) :
    unable to open file 'D:/Dropbox/CorpuslinguÃ¯stiek project/antconc resultaten/img/name.png' for writing
  2: In png(filename = paste0(wd, "/img/name.png")) : opening device failed
  </code></pre>