在rstudio中加载json文件时出错

时间:2019-02-09 19:29:01

标签: json rstudio jsonlite rjson ndjson

我尝试了rjson,jsonlite和ndjson。当尝试加载json文件时,它们全部返回以下错误消息。 即

data <- read_json("/home/stathis/Desktop/09-02-2019_16")


Error in parse_con(txt, bigint_as_char) : 
  lexical error: invalid char in json text.
                                      {'owner_name': 'sotarako', 'loc_
                     (right here) ------^

您可以在下面找到json文件的前两行:

{'owner_name': 'sotarako', 'loc_id': 0, 'display_url': 'https://instagram.fath5-1.fna.fbcdn.net/vp/07ee00d0a9de5671a2e8ccd472ee0d96/5CFE300C/t51.2885-15/e35/47585464_135865460750958_4471115700828804682_n.jpg?_nc_ht=instagram.fath5-1.fna.fbcdn.net', 'loc_lon': 0, 'loc_lat': 0, 'loc_name': '', 'taken_at_timestamp': 1546573989, 'caption': 'At the time I had no idea what those red clouds were. I assumed it was the sand storms from Egypt because that\u2019s what I overheard a guy saying on his cellphone. #matifire #athens', 'shortcode': 'BsMsBfABfCf', 'id': '1949126354796933279', 'owner_id': '6425012335'}
{'owner_name': 'scientologyvolunteerministers', 'loc_id': 0, 'display_url': 'https://instagram.fath5-1.fna.fbcdn.net/vp/01d2fc475de1088ed3bfdd1879a44fd2/5CF4B718/t51.2885-15/e15/39910768_1085936101581145_4945610959663136768_n.jpg?_nc_ht=instagram.fath5-1.fna.fbcdn.net', 'loc_lon': 0, 'loc_lat': 0, 'loc_name': '', 'taken_at_timestamp': 1535080295, 'caption': 'Compassionate Help in the Aftermath of Greece Fires - Get the story: http://qoo.ly/rjkbr and on ScientologyNews.org. Scientology Volunteers on hand to aid since the July 23 conflagration that destroyed the town of Mati, Greece, continue to bring help and comfort to those in need. Record-breaking temperatures and gale-force winds combined to create Greece\u2019s deadliest fire in decades. Worst hit was the resort town of Mati, some 20 miles east of Athens\u2014now entirely destroyed.', 'shortcode': 'Bm2Jim3FFFn', 'id': '1852710257316614503', 'owner_id': '7110748054'}

到底是什么问题?

谢谢

0 个答案:

没有答案