我试图用R中的fromJSON转换这个json文件而且我不能
{"data":[
{"id_str": "972985896999014403", "created_at": "Mon Mar 12 00:01:29 +0000 2018", "text": "One week later, and Ryan Seacrest\u2019s weird #Oscars night is still with ", "name": "680 CJOB", "screen_name": "680CJOB"}}, ........
我的代码:
json_data<-fromJSON(file="input.json")
Error in fromJSON(file = "input.json") :
argument "txt" is missing, with no default
答案 0 :(得分:0)
您只有fromJSON
的参数名称错误。它应该是txt
或者,因为它是第一个未命名的:
json_data <- fromJSON(txt = "input.json")
# also works
json_data <- fromJSON("input.json")