Converting JSON to CSV in R

setwd("/home/jacoblevernier/Documents/UO/Coursework/Winter 2014/LIB 607 Digital Scholarship Methods/Demo for Web Scraping/Example Datasets/")

# Load the jsonlite library
library(jsonlite)

# The filename for the JSON feed:
json_file <- "chroniclingamerica.loc.gov.json318_rows"

# Read that file:
json_data <- fromJSON(readLines(json_file))

# Take a look at the parsed JSON:
View(json_data)

# Examples for looking at the data:
names(json_data)
names(json_data$items)
json_data$items$place[[2]] # The "place" metadata for search result number 2

Related

Next
Previous