2017-03-06 18 views
1

以下のフォーマットでJSONファイルをMongodbからエクスポートしました。私はそれからデータフレームを作成しようとしていますが、このエラーをスローするので、tidyjsonに読み込ませることはできません。 R JSONファイルをtidyjsonを使用してデータフレームに変換

Error: lexical error: invalid char in json text. 
         {  "_id" : ObjectId("586e684427a06a4a658fa 
        (right here) ------^ 

Iはread_json( "file.json")

ファイルが "拡張" JSON形式を生成mnogodbによるこのエラーは

{ 
    "_id" : ObjectId("586e684427a06a4a658fa28e"), 
    "expires_in" : ISODate("2016-11-19T22:16:57.418+0000"), 
    "job_type" : "Satellite Sales & Service", 
    "inbound_id" : ObjectId("586e68440c83945fb2658754"), 
    "created_at" : ISODate("2017-01-05T15:37:40.850+0000"), 
    "action_states" : [ 
     { 
      "_id" : ObjectId("586e684627a06a4a658fa293"), 
      "transition_duration" : NumberInt(0), 
      "name" : Symbol("created"), 
      "actor" : "home_owner", 
      "created_at" : ISODate("2017-01-05T15:37:42.297+0000") 
     }, 
     { 
      "_id" : ObjectId("586e68ad0c83945fb2658825"), 
      "transition_duration" : NumberInt(1), 
      "name" : Symbol("accepted"), 
      "reason" : null, 
      "actor" : "contractor", 
      "created_at" : ISODate("2017-01-05T15:39:25.924+0000") 
     } 
    ] 
} 
{ 
    "_id" : ObjectId("586e675d27a06a4a658fa264"), 
    "expires_in" : ISODate("2016-11-19T22:16:57.418+0000"), 
    "job_type" : "Satellite Sales & Service", 
    "inbound_id" : ObjectId("586e675d0c83945fa2f6e190"), 
    "created_at" : ISODate("2017-01-05T15:33:49.934+0000"), 
    "action_states" : [ 
     { 
      "_id" : ObjectId("586e675f27a06a4a658fa267"), 
      "transition_duration" : NumberInt(0), 
      "name" : Symbol("created"), 
      "actor" : "home_owner", 
      "created_at" : ISODate("2017-01-05T15:33:51.097+0000") 
     }, 
     { 
      "_id" : ObjectId("586e694c0c83945faae36559"), 
      "transition_duration" : NumberInt(8), 
      "name" : Symbol("accepted"), 
      "reason" : null, 
      "actor" : "contractor", 
      "created_at" : ISODate("2017-01-05T15:42:04.116+0000") 
     } 
    ] 
} 

答えて

関連する問題