The function to_json is a generic and idempotent interface to toJSON.

to_json(x, auto_unbox = TRUE, ...)

# S3 method for default
to_json(x, auto_unbox = TRUE, ...)

# S3 method for list
to_json(x, auto_unbox = TRUE, ...)

# S3 method for json
to_json(x, ...)

# S3 method for Trait
to_json(x, auto_unbox = TRUE, ...)

# S3 method for Bytes
to_json(x, ...)

# S3 method for Vector
to_json(x, ...)

# S3 method for List
to_json(x, auto_unbox = TRUE, ...)

# S3 method for 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 method

  • to_json(list): S3 method for lists.

  • to_json(json): S3 method for JSON character strings. Returns its argument as is, making to_json idempotent.

  • to_json(Trait): S3 method for 'TraitClass' objects, i.e. traitlets.

  • to_json(Bytes): S3 method for 'BytesClass' objects

  • to_json(Vector): S3 method for 'VectorClass' objects

  • to_json(List): S3 method for 'ListClass' objects

  • to_json(Widget): S3 method for 'WidgetClass' objects, i.e. jupyter widgets