title: Is there a way to initialize or modify a list that allows to reference previous values?
body: <p>I want to store non-rectangular data in a structure, e.g. in a <code>list</code>.</p>
  <p>Referencing previous data works using a <code>tibble</code>, e.g. like this:</p>
  <pre><code>dat &lt;- tibble(a = 2, 
                b = list(c(a + 1, a + 2)),
                c = list(tibble(a = a, b = 3)))
  </code></pre>
  <p>Note that because <code>tibble</code> does not allow <code>tibble</code> in columns (otherwise the data would not be rectangular), we have to wrap the <code>tibble</code> in a list and <code>dat$c</code> does not return the <code>tibble</code>, for that we need <code>dat$c[[1]]</code>.</p>
  <p>The latter problem can be solved with a <code>list</code>.</p>
  <pre><code>dat2 &lt;- list(a = 2, 
               b = c(3, 4), 
               c = tibble(a = 2, b = 3))
  </code></pre>
  <p>However, now I can't construct the data element with reference to previous entries:</p>
  <pre><code>dat2 &lt;- list(a = 2, 
               b = c(a + 1, a + 2), 
               c = tibble(a = a, b = 3))
  &gt; Error: object 'a' not found
  </code></pre>
  <p>My question: Is there a way to construct a non-rectangular data structure that does support construction by reference to previous entries?</p>