library(knitr)
library(XML)
library(jsonlite)
'Reading HTML File'
## [1] "Reading HTML File"
table <- readHTMLTable("file:///C:/Users/Fahad/Desktop/Books.html", header = TRUE)
table
## $`NULL`
## Title
## 1 How To Draw
## 2 How To Design Cars Like a Pro
## 3 H-Point
## Authors Publisher Pages
## 1 Scott Robertson and Thomas Bertlling Design Studio Press 272
## 2 Tony Lewin and Ryan Borroff Motorbooks 208
## 3 Staurt Macey, Geoff Wardle and Ralph Gilles Design Studio Press 224
kable(table)
| How To Draw |
Scott Robertson and Thomas Bertlling |
Design Studio Press |
272 |
| How To Design Cars Like a Pro |
Tony Lewin and Ryan Borroff |
Motorbooks |
208 |
| H-Point |
Staurt Macey, Geoff Wardle and Ralph Gilles |
Design Studio Press |
224 |
|
"Reading Json File"
## [1] "Reading Json File"
json <- fromJSON("C:/Users/Fahad/Desktop/Books.json")
json
## Name
## 1 How To Draw
## 2 How To Design Cars Like a Pro
## 3 H-Point
## Authors Publisher Pages
## 1 Scott Robertson and Thomas Bertlling Design Studio Press 272
## 2 Tony Lewin and Ryan Borroff Motorbooks 208
## 3 Staurt Macey, Geoff Wardle and Ralph Gilles Design Studio Press 224
kable(json)
| How To Draw |
Scott Robertson and Thomas Bertlling |
Design Studio Press |
272 |
| How To Design Cars Like a Pro |
Tony Lewin and Ryan Borroff |
Motorbooks |
208 |
| H-Point |
Staurt Macey, Geoff Wardle and Ralph Gilles |
Design Studio Press |
224 |
"Reading XML File"
## [1] "Reading XML File"
xml <- xmlToDataFrame("file:///C:/Users/Fahad/Desktop/Books.xml")
xml
## Name Authors
## 1 How To Draw Scott Robertson and Thomas Bertlling
## 2 Desgin Cars Like a Pro Tony Lewin and Ryan Borroff
## 3 H-Point Staurt Macey, Geoff Wardle and Ralph Gilles
## Publisher Pages
## 1 Design Studio Press 272
## 2 Motorbooks 208
## 3 Design Studio Press 224
kable(xml)
| How To Draw |
Scott Robertson and Thomas Bertlling |
Design Studio Press |
272 |
| Desgin Cars Like a Pro |
Tony Lewin and Ryan Borroff |
Motorbooks |
208 |
| H-Point |
Staurt Macey, Geoff Wardle and Ralph Gilles |
Design Studio Press |
224 |
Conclusion
“As we have loaded all the three files and read them in R we did not see much of a difference in terms of data when read in R.‘’as We can see that although all three file are very different from each other in terms of the data structure but R made it very’ ‘easy and concise to manipulate data from each source as there is not much of difference in data from all three sources when loaded’ ‘R.’