Things I've gathered from reading github issues of the existing #RStats JSON packages (e.g. {jsonlite}) is that:

* Everyone has weird data
* How nesting should be handled is different for every user
* How to handle NA/NULL when writing JSON is different for every user
* How to handle NA/NULL when reading JSON is different for every user.

Summary: JSON + R = prickly beast!

As a fantastic example of R/JSON issues:

Namibia missing from dataset!

A certified #NoPrize if you can guess why without visiting the issue!!

https://github.com/jeroen/jsonlite/pull/318

#Rstats

Added naStrings option to 'null_to_na()' and precessors by joachim-gassen · Pull Request #318 · jeroen/jsonlite

Tries to address #98 and #314. I was also affected by this corner case (downloading of Google Trends data for Namibia with the {gtrendsR} package failing systematically). As it is likely to regular...

GitHub
@coolbutuseless He-he, and these guys keep mocking Excel after that "gene names converted to dates" story.
On the other hand this bug can be made perfectly reproducible and versioned.
@tyx @coolbutuseless also this bug doesn’t regularly come up in the work of users at all levels. Eg recently I gave customers a csv of data to work with. They’re gonna open in Excel so I did the same before sending - to make sure they don’t encounter any mangled data. But of course Excel has to turn the value “2 - 4” into a truncated date, silently, and overwrite the original value. I had to go to my upstream R process and change the string to “2 to 4”.
@jimgar @coolbutuseless Sure! But the main point of my sarcasm, other than just cruel laugh I'm always guilty of, is that you can shoot your leg using any language/tool, and R has a pretty sensitive trigger (also a steep learning curve and obscure defaults). Still better than Excel as main data processing tool.
@coolbutuseless Sodium used to go missing (or appear from thin air) with the {webchem} package for the same reason
@coolbutuseless Not to mention the difficulty distinguishing scalars from length-1 arrays when writing from R to JSON.