JSON (using jsonlite) parsing error in R

会有一股神秘感。 提交于 2019-12-05 18:15:27

Try changing your data file to below

[
{"id":1140854908,"name":"'Amran"} 
,{"id":1140852651,"name":"'Asir"} 
,{"id":1140855190,"name":"'Eua"} 
,{"id":1140851307,"name":"A Coruna"} 
,{"id":1140854170,"name":"A`Ana"}
]

The same code worked for me.. It is looking for an array..

Your file is a newline delimited JSON (http://ndjson.org/). You can read it with jsonlite like this:

try <- stream_in(file("states.txt"))
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!