我正在尝试使用Quanteda的文本文件包装器来读取以下link的JSON:
我的代码如下:
textfile("20070101-20080214_ehfdpezgqg_2007_01_01_00_00_activities.json",
textField = "body")
但是当我运行它时,我得到以下错误,尽管链接文件是Twitter JSON。
Error in data.table::rbindlist(lapply(lines, function(x) jsonlite::fromJSON(x, :
Column 3 of item 1 is length 19, inconsistent with first column of that item which is length 1. rbind/rbindlist doesn't recycle as it already expects each item to be a uniform list, data.frame or data.table
In addition: Warning messages:
1: In doTryCatch(return(expr), name, parentenv, handler) :
Doesn't look like Tweets json file, trying general JSON
2: In if (e == paste("There is no field called", textField, "in file", :
the condition has length > 1 and only the first element will be used
3: In value[[3L]](cond) :
File doesn't contain a single valid JSON object, trying line-delimited json
我已经阅读了Quanteda的文档,对于这里发生的事情有点不透明。我可以使用常规R JSON阅读器阅读此文件,但我想以“Quanteda方式”阅读它。