I need to create a JSON string from R using toJSON
. My issue is that part of the JSON should contain an empty JSON object {}
. I thought list()
would do it for me:
> fromJSON("{}")
list()
> toJSON(list())
[1] "[]"
[Scratches head]
Anybody know how to get a {}
using toJSON
? I am using a lib that does the encoding, so answers that do not use toJSON
will not help me.
Thanks!