Let's say I have this data:
df <- data.frame(value = c("foo", "bar", "baz"))
A simple toJSON gets me this:
[{"value":"foo"},{"value":"bar"},{"value":"baz"}]
But if I need the values as single element arrays, how do I structure the original data? I've tried a few variations involving c(), list(), and I(). Nothing works to get me this output:
[{"value":["foo"]},{"value":["bar"]},{"value":["baz"]}]