HW05: Debugging and generating R Markdown documents


Due by 11:59pm CT (Chicago) on July 1st.

Fork the hw05 repository

Go here to fork the repo for homework 05.

Debugging code

The repository contains an R script called babynames.R. This script includes code to conduct analysis of baby name popularity in the United States using the babynames package. Alas its author made some mistakes and the script currently does not work. Fix the errors/warnings in the script to generate the desired output.

Working with R Markdown documents

The homework repository contains a file called hiv-profile.Rmd.

  1. The file has some problems. Fix the problems so you can successfully knit the document in its existing form.
  2. Create a parameterized report that allows you generate hiv-profile.Rmd for any country in the dataset. Use this parameterized R Markdown document to generate a separate report for each country and save them as HTML documents to a folder called reports.
Each file should be named after the country’s iso3 code. For example, the report for the United States should be called USA.html.

Submit the assignment

Your assignment should be submitted as several files:

  1. The revised babynames.R.
  2. The revised hiv-profile.Rmd and the successfully rendered hiv-profile.md with associated output files (e.g. images).
  3. An R script that renders all the individual country HIV profiles, as well as rendered HTML files.

Follow instructions on homework workflow. As part of the pull request, you’re encouraged to reflect on what was hard/easy, problems you solved, helpful tutorials you read, etc.


Needs improvement: The R script has not been successfully fixed. The broken R Markdown document still does not knit. You manually generated each country’s report.

Satisfactory: Solid effort. Hits all the elements. No clear mistakes. Easy to follow (both the code and the output). Nothing spectacular, either bad or good.

Excellent: Repository contains a detailed README.md explaining how the files in the repo should be executed. Broken R Markdown document successfully knits. Used iterative operations to generate each country’s HIV profile.

Benjamin Soltoff
Benjamin Soltoff
Assistant Senior Instructional Professor in Computational Social Science & the College