title: How to read a newline delimited JSON file from R?
body: <p>I have a newline delimited (i.e., each JSON object is confined to 1 line in the file):</p>
  
  <pre><code>{"name": "json1"}
  {"name": "json2"}
  {"name": "json3"}
  </code></pre>
  
  <p>In Python I can easily read it as follows (I must use the encoding <code>encoding='cp850'</code> to read my real data):</p>
  
  <pre><code>import json
  
  objs = []
  with open("testfile.json", encoding='cp850') as f:
      for line in f:
          objs.append(json.loads(line))
  </code></pre>
  
  <p>How can I do a similar trick in R?</p>
  
  <p>At the end I want to get a data.frame:</p>
  
  <pre><code>library("jsonlite")
  library("data.table")
  
  d &lt;- fromJSON("testfile.json", flatten=FALSE)
  df &lt;- as.data.frame(d)
  </code></pre>