title: Why R function doesn't use variable from parent parent environment?
body: <p>I don't get, why glue_data doesn't use a variable available from parent parent environment? See code below. Function <code>test_call_glue_directly</code> returns desired result. Function <code>test_call_glue</code> returns error  <code>Error in eval(x, envir = data, enclos = envir) : object 'c_1' not found</code></p>
  
  <p>Of course, my real function has more than one variable. <code>formula_1</code> might refer to <code>{c_2}</code> and <code>{c_3}</code>. Or <code>{c_456}</code>, <code>{c_7}</code>, <code>{c_8}</code>. The count of <code>c_*</code> might be different.</p>
  
  <p>Is there a way how to create new environment specifically for calling this glue_data? Or pull variable from parent environment? Or some better way how to organize my code? I don't want to pass the parameter <code>c_1</code> to funciton <code>fill_1</code> because in my real script there could be unknown count of variables with unknown names. </p>
  
  <pre><code>fill_1 &lt;- function(letts, n0, formula_x) {
    purrr::cross_df(list(row = n0, column = letts)) %&gt;%
      glue::glue_data(formula_x) %&gt;%
      matrix(ncol = length(letts)) %&gt;%
      as.data.frame
  }
  
  
  test_call_glue &lt;- function() {
    c_1 &lt;- "C"
    formula_1 &lt;-  "={c_1}{row}"
    fill_1(c("A"), c(1:5), formula_1)
  }
  
  
  test_call_glue_directly &lt;- function() {
    # The function without wrapping glue_data in function
    c_1 &lt;- "C"
    formula_1 &lt;-  "={c_1}{row}"
    purrr::cross_df(list(row = c(1:5), column = c("A"))) %&gt;%
      glue::glue_data(formula_1) %&gt;%
      matrix(ncol = 1) %&gt;%
      as.data.frame
  }
  
  test_call_glue_directly()
  test_call_glue()
  </code></pre>