对于我的博士项目,我需要将 JSONL 文件读入 R(扩展名不是 json,是 jsonl)并将其转换为 csv。我尝试使用基于 jsonlite 的代码,但它给了我一个错误:
library(jsonlite)
data <- "/Users/chiarap/tweets.jsonl"
dat <- fromJSON(sprintf("[%s]", paste(readLines(data), collapse=",")))
Error: parse error: unallowed token at this point in JSON text
EFEF","notifications":null}},,,{"in_reply_to_status_id_str":
(right here) ------^
Run Code Online (Sandbox Code Playgroud)
谢谢