作者:狼与鹰的爱_340 | 来源:互联网 | 2023-05-18 17:21
IhaveadataframeinRwithtwocolumns,forexample:我有一个R中的数据框架,有两个列,例如:dfdata.frame(xc(1,
I have a data frame in R with two columns, for example:
我有一个R中的数据框架,有两个列,例如:
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:
我需要编写一个R脚本将这个data.frame转换为一个JSON数组,如下所示:
[[1, 5],[2, 6],[3, 7],[4, 8]]
How do I convert my data frame to a JSON array of rows in R?
如何将数据帧转换为R中的JSON行数组?
1 个解决方案