Quanteda Textfile Twitter JSON Error Reading

105 views Asked by At

I am trying to use Quanteda's textfile wrapper to read in the JSON at the following link:

My code is the following:

textfile("20070101-20080214_ehfdpezgqg_2007_01_01_00_00_activities.json",
     textField = "body")

But when I run this I obtain the following error, despite the linked file being a 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

I have read the documentation for Quanteda and it is a little opaque about what is going on here. I can read this file in using the regular R JSON readers, but I want to read it in "the Quanteda way".

0

There are 0 answers