The jsonlite Package: A Practical and Consistent Mapping Between JSON Data and R Objects
By Jeroen Ooms. arXiv.org, 2014
301 citations recorded by the source corpus.
A naive realization of JSON data in R maps JSON arrays to an unnamed list, and JSON objects to a named list. However, in practice a list is an awkward, inefficient type to store and manipulate data. Most statistical applications work with (homogeneous) vectors, matrices or data frames. Therefore JSON packages in R typically define certain special cases of JSON structures which map to simpler R types. Currently there exist no formal guidelines, or even consensus between implementations on how R data should be represented in JSON. Furthermore, upon closer inspection, even the most basic data structures in R actually do not perfectly map to their JSON counterparts and leave some ambiguity for edge cases. These problems have resulted in different behavior between implementations and can lead to unexpected output. This paper explicitly describes a mapping between R classes and JSON data, highlights potential problems, and proposes conventions that generalize the mapping to cover all common structures. We emphasize the importance of type consistency when using JSON to exchange dynamic data, and illustrate using examples and anecdotes. The jsonlite R package is used throughout the paper as a reference implementation.
Subfields: Artificial Intelligence, Environmental Engineering
View Paper: https://www.semanticscholar.org/paper/489c7727540dfc9fa51db05da42aa08bfb6451d3
How researchers see this paper
The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.
In Artificial Intelligence
- Adam H. Sparks
- Hadley Wickham
- Jeroen Ooms
- Max Kuhn
- Garrett Grolemund
- R. Francis
- Miron Bartosz Kursa
- Paul J. McMurdie
In Environmental Engineering
Citations in the corpus
- nasapower: A NASA POWER Global Meteorology, Surface Solar Energy and Climatology Data Client for R (2018, methodology): “The query returns a json response, which is parsed by jsonlite (Ooms, 2014) to obtain the url of the .csv file that has been requested.”
- Welcome to the Tidyverse (2019, background): “…McGowan & Bryan, 2019), haven (Wickham & Miller, 2018), hms (Müller, 2018), lubridate (Spinu, Grolemund, & Wickham, 2018), magrittr (Bache & Wickham, 2014), modelr (Wickham, 2018b), readxl (Wickham & Bryan, 2019), reprex (Bryan, Hester, Robinson, & Wickham, 2019), rvest (Wickham, 2019d),…”