Skip to contents

Recursive-descent JSON parser with jsonlite-style simplification: arrays of same-type scalars become vectors, arrays of consistently keyed objects become data frames (when simplify = TRUE).

Usage

morie_fetch_json(txt, simplify = TRUE)

Arguments

txt

A single JSON string (or raw vector).

simplify

Simplify arrays to vectors / data frames (default TRUE, mirroring jsonlite::fromJSON).

Value

The parsed R object.

Examples

morie_fetch_json('{"a": [1, 2, 3], "b": "x"}')
#> $a
#> [1] 1 2 3
#> 
#> $b
#> [1] "x"
#>