Unnesting JSON using R

Source=https://jsonformatter.org/e038ec

The above is nested json.

I want the output to be as below
dataElements.name,dataElements.id,categoryOptionCombos.name,categoryOptionCombos.id

Any help in r?

Hi,

How would you like to 'unlist' this? as a data frame?
JSON is different from a data frame in that it can store lists of varying length or subdivisions, which you can't simply convert to a table format. For example: categoryOptionCombos.name is a sublist of 3 values, so for every dataElements.name,dataElements.id you would have 3 values of categoryOptionCombos.name. Of course you can repeat the values higher in the list to force it into table format, but I don't know if that's what you want?

PJ

For example: categoryOptionCombos.name is a sublist of 3 values, so for every dataElements.name,dataElements.id you would have 3 values of categoryOptionCombos.name. Of course you can repeat the values higher in the list to force it into table format, but I don't know if that's what you want?

That is what I want, the repeatitions.

Try this function jsonlite::fromJSON from the jsonlite package

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.