I am working in R with huge JSON files. These JSON files have lists that are nested into lists that are nested into lists (etc...). So that there are multiple levels of elements.
My question is how can I extract only the key elements stored at one specific level without getting the associated values with all his nested lists ?
The files that I am working on look like more and less like this :
{
"Key 1 at level 1": "value x",
"Key 2 at level 1": "value x",
"Key 3 at level 1": {
"Key 1 at level 2": {
"Key 1 at level 3": "value x",
"Key 2 at level 3": "value x",
"Key 3 at level 3": "value x"
},
"Key 2 at level 2": {
"Key 4 at level 3": "value x",
"Key 5 at level 3": "value x",
"Key 6 at level 3": "value x"
}
}
}
So, in this example, what I would like is to retrieve a list that would contain "Key 1 at level 2" and "Key 2 at level 2".
You can find one real example in this link : http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/rest/swagger.json (carefull because i's huge)
Sorry if this question has been asked before. I have been spending a long time looking for an answer but I didn't find anything.
Thanks in advance.