0

I get a NULL value when trying to load my .json file in R studio. I've tried both loading the file with the jsonlite and the rjson package, but with no result.

Tried both:

library("rjson")

result <- fromJSON(file = "ice.json")

&

library(jsonlite)

winners <- fromJSON("ice.json", flatten=TRUE)

But both return NULL value when trying to load in R.

(The json file consists of streamed tweets via the twitter API, the.json file starts and ends with the following code:)

    {"created_at":"Tue Feb 22 11:18:05 +0000 2022",'
...
"timestamp_ms":"1645528688239"}

Most thankful for any clues on how to solve this issue!

benson23
  • 8,765
  • 8
  • 15
  • 32
vilsef
  • 17
  • 1
  • I cannot replicate your error. I saved your data (minus the "...") as `test.json`, and was able to read it with `jsonlite::fromJSON("test.json", flatten = TRUE)`. Are you able to create a reprex? See more info here: https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – jpiversen Feb 22 '22 at 11:56

0 Answers0