A Genereric Converter to JSON
Source:R/json.R
, R/traitlets.R
, R/traitlets-bytes.R
, and 2 more
to_json.Rd
The function to_json
is a generic and idempotent interface
to toJSON
.
Usage
to_json(x, auto_unbox = TRUE, ...)
# Default S3 method
to_json(x, auto_unbox = TRUE, ...)
# S3 method for class 'list'
to_json(x, auto_unbox = TRUE, ...)
# S3 method for class 'json'
to_json(x, ...)
# S3 method for class 'Trait'
to_json(x, auto_unbox = TRUE, ...)
# S3 method for class 'Bytes'
to_json(x, ...)
# S3 method for class 'Vector'
to_json(x, ...)
# S3 method for class 'List'
to_json(x, auto_unbox = TRUE, ...)
# S3 method for class 'Widget'
to_json(x, ...)
Arguments
- x
An object to be converted as JSON
- auto_unbox
A logical value, whether one-element a JSON list should be changed into JSON scalar.
- ...
Other arguments, passed on to
toJSON
.
Methods (by class)
to_json(default)
: Default S3 methodto_json(list)
: S3 method for lists.to_json(json)
: S3 method for JSON character strings. Returns its argument as is, makingto_json
idempotent.to_json(Trait)
: S3 method for 'TraitClass' objects, i.e. traitlets.to_json(Bytes)
: S3 method for 'BytesClass' objectsto_json(Vector)
: S3 method for 'VectorClass' objectsto_json(List)
: S3 method for 'ListClass' objectsto_json(Widget)
: S3 method for 'WidgetClass' objects, i.e. jupyter widgets