title: Assigning namespace variables inside of a function
body: <p>I'm struggling to assign a namespace variable inside of a function. Consider this example using the CRAN package "qcc":  <code>qcc()</code> generates a plot, but 
  the display options of that plot are controlled by <code>qcc.options()</code>.</p>
  
  <p>When working in global, everything is fine:</p>
  
  <pre><code>library(qcc)
  qcc.options(bg.margin="red")        # sets margin background colour, i.e.
                                      # qcc:::.qcc.options$bg.margin is "red"
  qcc(rnorm(100), type = "xbar.one")  # generates a plot with red margin
  </code></pre>
  
  <p>But when working in the local environment of a function, <code>qcc</code> and <code>qcc.options</code> seem to use the namespace differently:</p>
  
  <pre><code>foo &lt;- function(x){
     qcc.options(bg.margin=x)
     qcc(rnorm(100), type = "xbar.one")
  }
  
  foo("green")  # generates a default plot with grey margins
  </code></pre>