Problem: I want to convert a list object into a JSON string. In Python I can easily do this with json.dumps() with dictionary object.
How can I do this in R?
library(jsonlite)
a <- list(y = list(x = c(1, 2, 3), y = c(3, 4, 5)))
toJSON(a)
## Expected Outcome
"[{\"y\":{\"x\":[1,2,3],\"y\":[3,4,5]}}]"