prettify, minify {jsonlite} | R 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)
[Package jsonlite version 1.8.8 Index]