Books Data

XML

x <- getURL("https://raw.githubusercontent.com/baroncurtin2/data607/master/week7/tables/books.xml") %>%
  xmlParse() %>%
  xmlToDataFrame(stringsAsFactors = FALSE) %>%
  data.frame

# show table
knitr::kable(x, "html") %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"))
category title authors isbn_13 page_count publisher edition
Textbook Automated Data Collection with R: A Practical Guide to Web Scraping and Text Mining Munzert,Simon; Rubba,Christian; Meißner,Peter; Nyhuis,Dominic 978-1118834817 474 Wiley 1
Textbook Text Mining with R: A Tidy Approach Silge,Julia; Robinson,David 978-1491981658 194 O’reilly Media 1
Textbook R for Data Science: Import, Tidy, Transform, Visualize, and Model Data Wickham,Hadley; Grolemund,Garrett 978-1491910399 522 O’reilly Media 1

HTML

h <- getURL("https://raw.githubusercontent.com/baroncurtin2/data607/master/week7/tables/books.html") %>%
  readHTMLTable(header = TRUE, which = 1) %>%
  tbl_df

# show table
knitr::kable(h, "html")%>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"))
Category Title Authors ISBN-13 Page Count Publisher Edition
Textbook Automated Data Collection with R: A Practical Guide to Web Scraping and Text Mining Munzert,Simon; Rubba,Christian; Meißner,Peter; Nyhuis,Dominic 978-1118834817 474 Wiley 1
Textbook Text Mining with R: A Tidy Approach Silge,Julia; Robinson,David 978-1491981658 194 O’reilly Media 1
Textbook R for Data Science: Import, Tidy, Transform, Visualize, and Model Data Wickham,Hadley; Grolemund,Garrett 978-1491910399 522 O’reilly Media 1

JSON

j <- getURL("https://raw.githubusercontent.com/baroncurtin2/data607/master/week7/tables/books.json") %>%
  fromJSON %>%
  data.frame

# show table
knitr::kable(j, "html")%>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"))
books.category books.title books.authors books.isbn13 books.pageCount books.publisher books.edition
Textbook Automated Data Collection with R: A Practical Guide to Web Scraping and Text Mining Munzert,Simon; Rubba,Christian; Meißner,Peter; Nyhuis,Dominic 978-1118834817 474 Wiley 1
Textbook Text Mining with R: A Tidy Approach Silge,Julia; Robinson,David 978-1491981658 194 O’reilly Media 1
Textbook R for Data Science: Import, Tidy, Transform, Visualize, and Model Data Wickham,Hadley; Grolemund,Garrett 978-1491910399 522 O’reilly Media 1

Compare

x == h
##      category title authors isbn_13 page_count publisher edition
## [1,]     TRUE  TRUE   FALSE    TRUE       TRUE      TRUE    TRUE
## [2,]     TRUE  TRUE   FALSE    TRUE       TRUE      TRUE    TRUE
## [3,]     TRUE  TRUE   FALSE    TRUE       TRUE      TRUE    TRUE
x == j
##      category title authors isbn_13 page_count publisher edition
## [1,]     TRUE  TRUE   FALSE    TRUE       TRUE      TRUE    TRUE
## [2,]     TRUE  TRUE   FALSE    TRUE       TRUE      TRUE    TRUE
## [3,]     TRUE  TRUE   FALSE    TRUE       TRUE      TRUE    TRUE
j == h
##   books.category books.title books.authors books.isbn13 books.pageCount
## 1           TRUE        TRUE         FALSE         TRUE            TRUE
## 2           TRUE        TRUE          TRUE         TRUE            TRUE
## 3           TRUE        TRUE          TRUE         TRUE            TRUE
##   books.publisher books.edition
## 1            TRUE          TRUE
## 2            TRUE          TRUE
## 3            TRUE          TRUE

There are slight differences in the way the author’s are represented in each. The other columns appear to be identical.