The RJSONIO Package

Last Release: 1.3-1 (04 Oct 2015)

This package provides facilities for reading and writing data in JSON - Javascript Object Notation - format. This allows us to read data in this format, e.g. from Web service applications, and also to export objects from R for use in Javascript/ECMAScript/ActionScript code. This is useful when generating dynamic plots with SVG (Scalable Vector Graphics), or Flash and ActionScript.

The primary functions in the package are

The package is extensible, allowing others to define S4 methods for toJSON for different R classes/types. Similarly, the fromJSON function allows the caller to specify a different callback handler which is invoked each time an element (e.g. number, string, key, start or end of an array or object) is found in the JSON content.

This package was motivated by the need to export R objects for use in creating dynamic graphics for the Web via SVG and Flash/FLEX. Since then, JSON has become a prominent format with many uses. Alex Couture-Beil's rjson package is another mechanism in R for reading and writing JSON content. However, that does not use S4/S3 methods and so is not readily extensible, but still useful.

Documentation


Duncan Temple Lang <duncan@r-project.org>
Last modified: Mon May 19 09:26:38 PDT 2014