RJSONIO icon indicating copy to clipboard operation
RJSONIO copied to clipboard

Don't emit whitespace padding around numeric data

Open jcheng5 opened this issue 11 years ago • 0 comments

Without this change, this is the behavior you get:

> RJSONIO::toJSON(head(cars, 3), digits = 12)
[1] "{\n \"speed\": [             4,             4,             7 ],\n\"dist\": [             2,            10,             4 ] \n}"

With this change:

> RJSONIO::toJSON(head(cars, 3), digits = 12)
[1] "{\n \"speed\": [ 4, 4, 7 ],\n\"dist\": [ 2, 10, 4 ] \n}"

The space savings are significant for many uses of Shiny and htmlwidgets.

jcheng5 avatar Jan 05 '15 19:01 jcheng5