title: How to set NULL argument in R function?
body: <p>I am trying to build a R function such that:</p>
  
  <pre><code>xplot&lt;-function(a, b, c, d, e, f, g=NULL, h, ...){
      par(mafrow=c(2,2))
      plot(a,b)#plot1
      plot(b,c)#plot2
      plot(e,f)#plot3
      if (!is.null(g)){plot(g,h} #plot4
  }
  </code></pre>
  
  <p>I would like the output such that:</p>
  
  <pre><code>xplot(a,b,c,d,e,f,h) 
  </code></pre>
  
  <p>output plot1,2,3, while </p>
  
  <pre><code>xplot(a,b,c,d,e,f,g, h) 
  </code></pre>
  
  <p>shows plot1,2,3,4. But I don't how to pass the <code>g=NULL</code> smoothly. When I test my function I either have to specify <code>g=NULL</code>, or come out with an error.</p>