title: Getting imported json data into a data frame
body: <p>I have a file containing over 1500 json objects that I want to work with in R. I've been able to import the data as a list, but am having trouble coercing it into a useful structure. I want to create a data frame containing a row for each json object and a column for each key:value pair.</p>
  
  <p>I've recreated my situation with this small, fake data set:</p>
  
  <pre><code>[{"name":"Doe, John","group":"Red","age (y)":24,"height (cm)":182,"wieght (kg)":74.8,"score":null},
  {"name":"Doe, Jane","group":"Green","age (y)":30,"height (cm)":170,"wieght (kg)":70.1,"score":500},
  {"name":"Smith, Joan","group":"Yellow","age (y)":41,"height (cm)":169,"wieght (kg)":60,"score":null},
  {"name":"Brown, Sam","group":"Green","age (y)":22,"height (cm)":183,"wieght (kg)":75,"score":865},
  {"name":"Jones, Larry","group":"Green","age (y)":31,"height (cm)":178,"wieght (kg)":83.9,"score":221},
  {"name":"Murray, Seth","group":"Red","age (y)":35,"height (cm)":172,"wieght (kg)":76.2,"score":413},
  {"name":"Doe, Jane","group":"Yellow","age (y)":22,"height (cm)":164,"wieght (kg)":68,"score":902}]
  </code></pre>
  
  <p>Some features of the data:</p>
  
  <ul>
  <li>The objects all contain the same number of key:value pairs although
  some of the values are null</li>
  <li>There are two non-numeric columns per object (name and group)</li>
  <li>name is the unique identifier, there are 10 or so groups</li>
  <li>many of the name and group entires contain spaces, commas and other punctuation.</li>
  </ul>
  
  <p>Based on this question: <a href="https://stackoverflow.com/questions/12508986/r-liststructurelist-to-data-frame">R list(structure(list())) to data frame</a>, I tried the following:</p>
  
  <pre><code>json_file &lt;- "test.json"
  json_data &lt;- fromJSON(json_file)
  asFrame &lt;- do.call("rbind.fill", lapply(json_data, as.data.frame))
  </code></pre>
  
  <p>With both my real data and this fake data, the last line give me this error:</p>
  
  <pre><code>Error in data.frame(name = "Doe, John", group = "Red", `age (y)` = 24,  : 
    arguments imply differing number of rows: 1, 0
  </code></pre>