I have the following code:
# install.packages("jsonlite")
require("jsonlite")
x = list(
test = "my_test",
data = c(1, 2, 3)
)
toJSON(x)
This prints:
{"test":["my_test"],"data":[1,2,3]}
I was expecting:
{"test":"my_test","data":[1,2,3]}
I've tried using some of the parameters from the documentation, but can't seem to get it right.