将带有子节点的json转换为R中的数据帧

时间:2015-02-24 00:20:28

标签: json r

我和孩子一起玩json如下:

{
"name": "Steve", "imageURL":"blah","id":"1",
"children": [

             {"name": "Melissa", "imageURL":"blah","id":"2",
             "children":[{"name": "Chris", "imageURL":"blah","id":"3"},
                         {"name": "Robert", "imageURL":"blah","id":"4"}]},

             {"name": "Joker", "imageURL":"blah","id":"5",
             "children":[{"Precilla": "word 1", "imageURL":"blah","id":"6"},
                         {"Gal": "word 8", "imageURL":"blah","id":"7"}]},

             {"name": "Seven", "imageURL":"blah","id":"8",
             "children":[{"Janeway": "word 1", "imageURL":"blah","id":"9"},
                         {"Nelix": "word 8", "imageURL":"blah","id":"10"}]}

             ]
}

我需要在R中将其表示为具有相同分层信息的数据帧。我需要稍后将其作为R中的相同JSON导出。

我尝试从数据框开始,如其他答案所示,讨论从R中的数据帧移动到带有子项的JSON,但它没有给出正确的结构。

0 个答案:

没有答案