Assignment 5
Learning Objectives
- read and parse XML
- retrieve data from XML
Data Files
Tasks
- Download and install RStudio and then build R Markdown Notebooks to execute your code and organize your output into a readable report. Note that you need version 1.0 or later for RStudio, so check your version and download the latest if needed.
Before diving into the programming problems, study the data file that is provided for the assignment:
- (20 Points) Load the XML document at the URL above directly into a data frame, i.e., do not download the file and save it.
- (30 Points) Write a function senatorsFrom() that returns the names of the senators for a given state, i.e., the function takes a state as an argument and returns the names of the senators for that state in a vector.
- (30 Points) Write a function senatorCountByParty() that returns the the number of senators for each party.
- (20 Points) Write a function listSenators() that displays all the senators sorted by last name, their party in parenthesis after their name, their state, and their phone number, e.g., John Kerry (D) - MA (202) 224-2742
Deliverables & Submission Instructions
Submit your .Rmd plus your .nb.html file generated by R Notebooks combined into a zip file. Upload the zip file to Blackboard. Make sure you follow the R Programming Style Guide.
Scoring
Total Number of Earnable Points: 100
Approximate Time to Complete: 3-4 hours
Due Date: see Calendar or Blackboard
Approximate Time to Complete: 3-4 hours
Due Date: see Calendar or Blackboard