Load packages
library(XML)
library(knitr)
library(jsonlite)
library(RCurl)
## Loading required package: bitops
Load JSON into R DataFrame
json_df <- fromJSON("https://raw.githubusercontent.com/san123i/CUNY/master/Semester1/607/Week7_JSON/Books.json")
kable(json_df)
| bk101 |
c(“Kathy Sierra”, “Bert Bates”) |
Head First Java, 2nd Edition |
Programming |
27.00 |
2000-10-01 |
An in-depth look at creating applications in Java. |
| bk102 |
Craig, Walls |
Spring in Action |
Programming |
393.99 |
2002-04-04 |
In detailed explaination about using Spring framework to develop Java applications |
| bk103 |
c(“Fostor, Provost”, “Tom, Fawcett”) |
Data Science for Business |
Programming |
33.15 |
2013-08-16 |
What you need to know about data mining and data-analytic thinking |
Load XML into R DataFrame
xml_data <- getURL("https://raw.githubusercontent.com/san123i/CUNY/master/Semester1/607/Week7_JSON/Books.xml")
xml_data <- xmlParse(xml_data)
root <- xmlRoot(xml_data)
xml_df <- xmlToDataFrame(root)
kable(xml_df)
| bk101 |
Kathy Sierra,Bert Bates |
Head First Java, 2nd Edition |
Programming |
27 |
2000-10-01 |
An in-depth look at creating applications in Java. |
| bk102 |
Craig Walls |
Spring in Action |
Programming |
39.99 |
2002-04-04 |
In detailed explaination about using Spring framework to develop Java applications |
| bk103 |
Fostor Provost,Tom Fawcett |
Data Science for Business |
Programming |
33.15 |
2013-08-16 |
What you need to know about data mining and data-analytic thinking |
Load HTML into R DataFrame
html_data <- getURL("https://raw.githubusercontent.com/san123i/CUNY/master/Semester1/607/Week7_JSON/Books.html")
html_df <- readHTMLTable(html_data)
kable(html_df)
| bk101 |
Kathy Sierra, Bert Bates |
Head First Java, 2nd Edition |
27 |
Programming |
2000-10-01 |
An in-depth look at creating applications in Java. |
| bk102 |
Craig Walls |
Spring in Action |
39.99 |
Programming |
2002-04-04 |
In detailed explaination about using Spring framework to develop Java applications |
| bk103 |
Fostor Provost,Tom Fawcett |
Data Science for Business |
33.15 |
Programming |
2013-08-16 |
What you need to know about data mining and data-analytic thinking |
|