Prettify or minify a JSON string
Prettify adds indentation to a JSON string; minify removes all indentation/whitespace.
prettify(txt, indent = 4) minify(txt)
txt |
JSON string |
indent |
number of spaces to indent |
myjson <- toJSON(cars) cat(myjson) prettify(myjson) minify(myjson)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.