Intermediate Importing Data in R
Filip Schouwenaars
Instructor, DataCamp
Before: pages and files from the web
JSON
Simple, concise, well-structured
Human-readable
Easy to parse and generate for computers
For communication with Web APIs
Application Programming Interface
Set of routines and protocols for building software
How different components interact
Web API
interface to get or add data to server
HTTP verbs (GET and others)
Get tweets
Place comments on tweets
Many applications
url <- "http://www.imdb.com/title/tt0095953/"
download.file(url, "local_imdb.html")
Jeroen Ooms
Improvement of earlier packages
Consistent, robust
Support all use-cases
install.packages("jsonlite") library(jsonlite)
fromJSON("http://www.omdbapi.com/?i=tt0095953&r=json")
List of 20
$ Title : chr "Rain Man"
$ Year : chr "1988"
$ Rated : chr "R"
$ Released : chr "16 Dec 1988"
$ Runtime : chr "133 min"
...
$ imdbVotes : chr "359,903"
$ imdbID : chr "tt0095953"
$ Type : chr "movie"
$ Response : chr "True"
Intermediate Importing Data in R