在Mac上运行以下调用时,出现如下错误
jsonlite::fromJSON(url(paste("https://fantasy.premierleague.com/api/element-summary/236")))
Error in parse_con(txt, bigint_as_char) : parse error: premature EOF
(right here) ------^
但是,以下调用正确运行,唯一的区别是省略了url()。
jsonlite::fromJSON(paste("https://fantasy.premierleague.com/api/element-summary/236"))
该错误的回溯如下:
4: parse_con(txt, bigint_as_char)
3: parseJSON(txt, bigint_as_char)
2: parse_and_simplify(txt = txt, simplifyVector = simplifyVector,
simplifyDataFrame = simplifyDataFrame, simplifyMatrix = simplifyMatrix,
flatten = flatten, ...)
1: jsonlite::fromJSON(url(paste("https://fantasy.premierleague.com/api/element-summary/236")))
我尝试了两个单独的安装,但结果相同。我想知道JSON第一行之后的换行符是否被解释为EOF ....