Last data update: 2014.03.03

R: Prettify or minify a JSON string
prettify, minifyR Documentation

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)

Results