0

I'm attempting to read in data from a .json file using jsonlite, and replace all NULL values with NA.

I'm using this code:

business <- stream_in(file("data/yelp_academic_dataset_business.json"), nullValue = NA)

And get this error

opening fileconnectionoldClass input connection.
Found 500 lines...
Error in simplify(lapply(page, parseJSON), ...) : 
  unused argument (nullValue = NA)
closing fileconnectionoldClass input connection.

According to ?stream_in I should be able to pass arguments for fromJSON in the ... section of the function call, but stream_in isn't accepting nullValue.

Any recommendations?

Chris
  • 313
  • 1
  • 11
  • `fromJSON` doesn't have an argument `nullValue`, what are you expecting to happen? – jeremycg Oct 06 '15 at 19:33
  • aye. try making it `null=NA` – hrbrmstr Oct 06 '15 at 19:38
  • Embarrassing... fromJSON in the RJSONIO package does have nullValue, I confused them. However null = NA doesn't work either, which appears to be a valid argument for toJSON but not fromJSON in jsonlite. – Chris Oct 06 '15 at 19:44

0 Answers0