#install.packages("rjson")
library(RCurl)
## Loading required package: bitops
library(XML)
library(jsonlite)
source1 = "https://raw.githubusercontent.com/OAdesanya/DATA_607/master/book.html"
source2 = "https://raw.githubusercontent.com/OAdesanya/DATA_607/master/book.json"
source3 = "https://raw.githubusercontent.com/OAdesanya/DATA_607/master/book.xml"
library(RCurl)
html_d = getURL(source1)
xml_d = getURL(source3)
json_d = getURL(source2)
library(RCurl)
library(XML)
library(jsonlite)
df = readHTMLTable(html_d, header = TRUE)
dfhtml = data.frame(df)
colnames(dfhtml) = c("Title", "Authors", "Publisher", "Year Published")
dfhtml
## Title Authors
## 1 Data Science for Dummies LillianPearson
## 2 Data Science from Scratch:First Principles with Python Joel Grus
## 3 SQL in 10 Minutes, Sams Teach Yourself: Edition 4 Ben Forta
## Publisher Year Published
## 1 Wiley 2009
## 2 Oreilly 2015
## 3 SAMS 2012
dfx = xmlParse(xml_d)
dfxml = xmlToDataFrame(dfx)
dfxml
## title authorname
## 1 Data Science for Dummies LillianPearson
## 2 Data Science from Scratch:First Principles with Python Joel Grus
## 3 SQL in 10 Minutes, Sams Teach Yourself: Edition 4 Ben Forta
## publisher yearpublished
## 1 Wiley 2009
## 2 O'Reilly 2015
## 3 SAMS 2012
dfj = fromJSON(json_d)
dfj
## $favbks
## title authors
## 1 Data Science for Dummies LillianPearson
## 2 Data Science from Scratch:First Principles with Python Joel Grus
## 3 SQL in 10 Minutes, Sams Teach Yourself: Edition 4 Ben Forta
## publisher yearpublished
## 1 Wiley 2009
## 2 Oreilly 2015
## 3 SAMS 2012