Skip to Main Content

DPDS Social Sciences Workshop Resources


Email this link:

Processing JSON Data

Objectives:

1. Describe the JSON data format.
2. Understand where JSON is typically used.
3. Appreciate some advantages of using JSON over tabular data.
4. Appreciate some disadvantages of processing JSON documents.
5. Use the jsonLite package to read a JSON file.
6. Display formatted JSON as dataframe.
7. Select and display nested dataframe fields from a JSON document.
8. Write tabular data from selected elements from a JSON document to a csv file.

Key Points:

1. JSON is a popular data format for transferring data used by a great many Web based APIs.
2. The complex structure of a JSON document means that it cannot easily be ‘flattened’ into tabular data.
3. We can use R code to extract values of interest and place them in a csv file.

Recommended Guides