I have nested JSON (lines) file which looks like
[{"ok":2, "nested": {"meh":2, "hehe":{"a":1, "b":2 }}},
{"ok":3, "nested": {"meh":10, "hehe":{"a":1, "b":2}}},
{"ok":4, "nested": {"meh":11, "hehe":{"a":1, "b":2}}}]
...
and I wish to unnest it into the data.frame represented CSV form
ok, nested.meh, nested.hehe.a, nested.hehe.b
2, 2, 1, 2
3, 10, 1, 2
4, 11, 1, 2
...
I tried
a = jsonlite::read_json("file.json")
But then a list of list, which seems to need custom coding to unnest, but I want to read general nested files. Is there a package to handle this? I looked through the documentation for rlist
but couldn't find info as rlist::table
didn't work.