Learn R Programming

RestRserve (version 1.2.3)

to_json: Simple JSON encoder

Description

Encode R objects as JSON. Wrapper around jsonlite::toJSON with default parameters set to following values: dataframe = 'columns', auto_unbox = unbox, null = 'null', na = 'null'.

Usage

to_json(x, unbox = TRUE)

Value

JSON string

Arguments

x

the object to be encoded

unbox

TRUE by default. Whether to unbox (simplify) arrays consists of a single element

Examples

Run this code
to_json(NULL)
to_json(list(name = "value"))

Run the code above in your browser using DataLab