title: Assigning a list of lists as a nested column
body: <p>I want to use purrr to generate some data based on some parameters.</p>
  
  <p>Shown below is a script that will generate a beta density on 0 to 1 parametedized by a <code>a</code> and <code>b</code> (the columns of the dataframe <code>params</code>.</p>
  
  <pre><code>library(tidyverse)
  
  a = c(2,4,6)
  b = c(10,12,14)
  
  params = expand.grid(a = a, b = b)
  
  gen_den = function(a,b){ 
    x = seq(0,1,0.1)
    den = dbeta(x = x, shape1 = a, shape2 = b)
  
    return(den)
    }
  
  # Want to assign this as a nested column
   params %&gt;% 
    pmap(gen_den)
  </code></pre>
  
  <p>I was wondering if I could assign the results of the <code>pmap</code> to a column, where each observation is a nested data frame.  Shown below is some desired output.  Here, the <code>data</code> column is the output from <code>gen_den(a,b)</code>.</p>
  
  <p><a href="https://i.stack.imgur.com/iGIht.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iGIht.png" alt="enter image description here"></a></p>