Assignment 6. Working with HTML and JSON. Approach.
For this assignment, I picked three books: Knowledge Development In Nursing/Theory and Process by Peggy L. Chinn and Maeona K. Kramer, Health Promotion and Disease Prevention in Clinical Practice by Jessica Coviello, and Evidence-Based Physical Examination /Best practices for Health and Well-Being Assessment by Kate Sustersic Gawlik, Bernadette Mazurek Melnyk, and Alice M. Teall. All three books relate to single-subject healthcare.
Book #1
Title: Knowledge Development In Nursing/Theory and Process
Authors: Peggy L. Chinn & Maeona K. Kramer
Publication year: 2018
Publisher: Elsevier Inc.
ISBN: 978-0-323-53061-3
Book# 2
Title: Health Promotion and Disease Prevention in Clinical Practice
Author: Coviello, Jessica Shank
Publication year: 2020
Publisher: Wolters Kluwer
ISBN: 9781496399960
Book#3
Title: Evidence-Based Physical Examination /Best practices for health and well-being assessment
Authors: Kate Gawlick, Bernadette Mazurek Melnyk, & Alice M. Teall
Publication year: 2021
Publisher: Springer Publishing Company, LLC
ISBN: 978-8261-6453-7
I will manually create two data files using Visual Studio Code: an HTML file containing a table of the book data and a JSON file showing the same data. Then, I will load the HTML data and JSON data in two separate R data frame. After that, I will compare the two data frames and determine whether they have any similarities and identities. At last, I will package my complete solution in a Quarto(.qmd) file and will publish it to rpubs.com so it will be publicly accessible on the web.
Code Base
# HTML and JSON files were created using Vusial sTudio code first.Then uploaded to GitHub. library(rvest)library(jsonlite)# Read HTML from GitHubhtml_url <-"https://raw.githubusercontent.com/Maximus2485/Assignment-6-Working-with-HTML-and-JSON/refs/heads/main/books.html"# Read the HTML table into a data framehtml_books <-read_html(html_url) |>html_element("table") |>html_table()# Read JSON from GitHubjson_url <-"https://raw.githubusercontent.com/Maximus2485/Assignment-6-Working-with-HTML-and-JSON/refs/heads/main/books.json"# Read JSON into a data framejson_books <-fromJSON(json_url)# Compare column names, data types, and valuesidentical(as.data.frame(html_books),as.data.frame(json_books))
[1] TRUE
## Conclusion A result of `TRUE` means the two data frames are identical.