Learn R Programming

jsonlite (version 0.9.5)

prettify, minify: Prettify or minify a JSON string

Description

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

Usage

prettify(txt)

minify(txt)

Arguments

txt
JSON string

Examples

Run this code
myjson <- toJSON(cars)
cat(myjson)
cat(prettify(myjson))
cat(minify(myjson))

Run the code above in your browser using DataLab