#My collection of useful libraries from the required reading
#library(pdftools)
#library(RCurl)
#library(RHTMLFORMS)
library(XML)
#library(RJSONIO)
library(jsonlite)
#library(rjson)
#library(ROAuth)
#library(SSOAP)
Pick three of your favorite books on one of your favorite subjects. At least one of the books should have more than one author. For each book, include the title, authors, and two or three other attributes that you find interesting.
Attributes Chosen: title, author(s), publishing house, length(of book), ISBN-10 Digit
threeBooksHTML <- "../DATA/books.html"
threeBooksXML <- "../DATA/books.xml"
threeBooksJSON <- "../DATA/books.json"
HTMLdf <- data.frame(readHTMLTable(threeBooksHTML))
XMLdf <- xmlToDataFrame(xmlParse(threeBooksXML))
#XML required a shift for the titles to appear
colnames(XMLdf) <- as.character(unlist(XMLdf[1,]))
XMLdf = XMLdf[-1, ]
JSONdf <- data.frame(fromJSON(threeBooksJSON))
HTMLdf; XMLdf; JSONdf
## NULL.Title
## 1 Elements of Programming Interviews in Python
## 2 The Algorithm Design Manual
## 3 The Stranger
## NULL.Authors
## 1 Adnan Aziz, Tsung-Hsien Lee, Amit Prakash
## 2 Steven S. Skiena
## 3 Albert Camus
## NULL.Publishing.House NULL.Length NULL.ISBN.10
## 1 CreateSpace Independent Publishing Platform 458 1537713949
## 2 Springer 730 1849967202
## 3 Vintage 123 9780679720
## Title
## 2 Elements of Programming Interviews in Python
## 3 The Algorithm Design Manual
## 4 The Stranger
## Authors
## 2 Adnan Aziz, Tsung-Hsien Lee, Amit Prakash
## 3 Steven S. Skiena
## 4 Albert Camus
## Publishing House Length ISBN-10
## 2 CreateSpace Independent Publishing Platform 458 1537713949
## 3 Springer 730 1849967202
## 4 Vintage 123 9780679720
## My.Favorite.Books.Title
## 1 Elements of Programming Interviews in Python
## 2 The Algorithm Design Manual
## 3 The Stranger
## My.Favorite.Books.Authors
## 1 Adnan Aziz, Tsung-Hsien Lee, Amit Prakash
## 2 Steven S. Skiena
## 3 Albert Camus
## My.Favorite.Books.Publishing.House My.Favorite.Books.Length
## 1 CreateSpace Independent Publishing Platform 458
## 2 Springer 730
## 3 Vintage 123
## My.Favorite.Books.ISBN.10
## 1 1537713949
## 2 1849967202
## 3 9780679720
(HTMLdf$NULL.Length[2] == XMLdf$Length[2]) && (HTMLdf$NULL.Length[2] == JSONdf$My.Favorite.Books.Length[2])
## [1] TRUE
Write R code, using your packages of choice, to load the information from each of the three sources into separate R data frames. Are the three data frames identical?
Yes, the three dataframes are identical(aside from header naming conventions and the character array in the JSON. However, I can de-nest or flatten the character array if need be!)