I have a data frame in R with two columns, for example:
df = data.frame(x=c(1, 2, 3, 4), y=c(5, 6, 7, 8))
I need to write an R script to convert this data.frame to a JSON array of arrays, like this:
[[1, 5],[2, 6],[3, 7],[4, 8]]
How do I convert my data frame to a JSON array of rows in R?