Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

prettify

Prettify or minify a JSON string


Description

Prettify adds indentation to a JSON string; minify removes all indentation/whitespace.

Usage

prettify(txt, indent = 4)

minify(txt)

Arguments

txt

JSON string

indent

number of spaces to indent

Examples

myjson <- toJSON(cars)
cat(myjson)
prettify(myjson)
minify(myjson)

jsonlite

A Simple and Robust JSON Parser and Generator for R

v1.7.2
MIT + file LICENSE
Authors
Jeroen Ooms [aut, cre] (<https://orcid.org/0000-0002-4035-0289>), Duncan Temple Lang [ctb], Lloyd Hilaiel [cph] (author of bundled libyajl)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.