The jsonlite Package: A Practical and Consistent Mapping Between JSON Data and R Objects
Jeroen Ooms

TL;DR
The paper defines a formal, consistent mapping between R data structures and JSON, addressing ambiguities and inconsistencies in existing implementations, with jsonlite as a reference.
Contribution
It introduces standardized conventions for representing R data in JSON, improving interoperability and reducing ambiguity across implementations.
Findings
Proposes a formal mapping between R classes and JSON structures
Highlights potential issues with existing JSON-R mappings
Uses jsonlite as a reference implementation to demonstrate conventions
Abstract
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,…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsGeochemistry and Geologic Mapping · Soil Geostatistics and Mapping
