When the files were first imported, the shape of the data frames were not consistent. In one case, it appeared as a list without attribute names. By tweaking the source file structures and doing some transformations with dplyr I was able to standardize their structure as shown below.
The source files can be found on github
xmldf <- xmlToDataFrame("Books.xml", stringsAsFactors = FALSE)
(xmldf)
htmldf <-
read_html("Books.html") %>%
html_nodes("table") %>%
.[[1]] %>%
html_table(trim = TRUE, header = TRUE) %>%
as.data.frame()
(htmldf)
jsondf <- fromJSON("Books.json") %>%
remove_rownames()
(jsondf)