1. Start a new Rmd document by going to File-->New File-->R Markdown-->OK. Save this document under the name yourname_hw10.Rmd. Delete the template Rmarkdown text and chunks (everything starting with ##R Markdown).

  2. Make a new code chunk (CTRL+Alt+I on Windows, Cmd + Option + I on a Mac). In that chuck, load tidyverse, magrittr, and rvest libraries.

library(tidyverse)
library(magrittr)
library(rvest)
  1. The goal of this assignment is to web-scrape the Wikipedia data on the corruption levels around the world: https://en.wikipedia.org/wiki/Global_Corruption_Barometer. Please follow the steps we did in class to extract the table that shows the rank, country name, and percent bribes. Compile these into a clean table. Make sure to label every column. Once you are done, print the first ten rows of your results to the screen to check your work.

  2. Knit the RMarkdown file (press the “Knit” button above) and read through the corresponding html file.

For the submission: submit your solution in an R Markdown file and (just for insurance) submit the corresponding html file with it.