title: Invalid characters with fromJSON function
body: <p>I am trying to import json file into R. For the purpose I am using packages such as <code>rjson</code>, <code>jsonlite</code>, <code>RJSONIO</code>, etc. I have tried different things as shown below but I got errors with all of them. </p>
  
  <pre><code>mydata &lt;- fromJSON(paste(readLines("result_prod_14-15_08_17.json"), collapse=""))
  </code></pre>
  
  <p>The error I got is:</p>
  
  <pre><code>Error: lexical error: invalid char in json text.
                           {  "_id" : ObjectId("59920f495401ac79452a0
                   (right here) ------^
  </code></pre>
  
  <p>Using 'RJSONIO' package:</p>
  
  <pre><code>md &lt;- stream_in(file("result_prod_14-15_08_17.json"))
  </code></pre>
  
  <p>produces the following error:</p>
  
  <pre><code>opening fileconnectionoldClass input connection.
  Error: parse error: premature EOF
                                         {
                       (right here) ------^
  closing fileconnectionoldClass input connection.
  </code></pre>
  
  <p>It must be something straightforward but since I am new to R I struggle to figure it out.</p>