Assignment 6
Learning Objectives
- read and parse XML
- retrieve data from XML
Data Files
See below
Tasks
Before diving into the programming problems, study the data file that is provided for the assignment:
- (25 Points) Load and then parse the XML document at the URL (http://www.cs.washington.edu/research/xmldatasets/data/auctions/ebay.xml) using xmlTreeParse(). The data sets contains bidding information about items on eBay. Create any intermediate data objects as deemed necessary to write a function named bidsLargerThan(x) to answer the following question: how many auctions had more than x bids? Use the function to output the answer.
- (75 Points) Take a look at the data set on trades during a single day for ESZ13 futures trades at the URL http://www.barchartmarketdata.com/data-samples/getHistory15.xml. After downloading the data to a local XML file, write and use the following functions to answer these retrieval queries:
- highestClosing() answers the question: at what time was the highest closing price for the security?
- totalVolume() answers the question: what was the total volume traded?
- averageVolume() answers the question: what was the average trading volume during each TWO HOUR block of the trading day? The function should place the result into a data frame containing the hour and average trading volume for that hour.
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 that whatever you submit works; no credit will be given for code that does not work. Upload the submission to Blackboard. Make sure you follow the R Programming Style Guide.
Scoring
Total Number of Earnable Points: 100
Approximate Time to Complete: 2-3 hours
Due Date: see Calendar or Blackboard
Approximate Time to Complete: 2-3 hours
Due Date: see Calendar or Blackboard
Hints
In Question (2), the XML file does not appear to load from the URL and must be saved to a local XML file. Here's a code fragment that loads the XML file, should xmlTreeParse() not work:
Fragment to load XML
If you receive the error Error: XML content does not seem to be XML: 'getHistory15.xml’ that often means that your file cannot be found and that you have specified an incorrect path or that the file does not exist.