I suspect I’m missing something obvious here, but how do I parse deeply nested structures in R using RJSONIO?
For example – suppose I directly want to reference $familyName in results.data.json$MRData$RaceTable$Races[[1]]$Results[[8]]$Driver as grabbed using the following snippet:
require(RJSONIO)
resultsURL='http://ergast.com/api/f1/2012/1/results.json'
results.data.json=fromJSON(resultsURL)
RJSONIO doesn’t appear to want to parse the ..$Results[[i]] data as structured elements?
from the examples above by default RJSON simplifies “collections/arrays of homogeneous scalar elements to R vectors”. This simplification can be controlled using
simplifyorsimplifyWithNames. In your example you can do any of the following to access the element you want: