Problem set 2

Due by 11:59 PM on Monday, October 7, 2019

Task 0: Getting started

Create a new RStudio project somewhere on your computer. Remember, in RStudio, “File > New Project ..”)

Open that new folder in Windows Explorer or macOS Finder (however you navigate around the files on your computer), and create a subfolder there named data.

Download the file below and place it in your new data/ folder. You’ll probably need to right click on each and choose “Save link as…”.

For the shape file, this will come as a zip file. You will need to extract all the files in this folder into a sub-folder in your /data/ folder.

Download this R Markdown file and place it in your newly-created project Again, you might have to right click on the link and choose “Save link as…”.

It contains an outline/skeleton of the two tasks you’ll need to do in this problem set. Lots of the code is pre-written again!

In the end, the structure of your new project directory should look something like this:

your-project-name\
  your-name_problem-set-2.Rmd
  your-project-name.Rproj
  data\
    Officer_Traffic_Stops.csv
    CMPD_Police_Divisions\
      CMPD_Police_Divisions.cpg
      CMPD_Police_Divisions.dbf
      CMPD_Police_Divisions.prj
      CMPD_Police_Divisions.shp
      CMPD_Police_Divisions.shx

Task: CMPD Traffic Stops



Follow the instructions in the R Markdown file you downloaded).

You will need to do two things: either write in complete sentences a response or write R code to fill in a chunk.

When you’re done, submit a compressed (zipped) folder of your entire project including the knitted HTML file, R Markdown file, data folder, and RStudio Project of your analysis on Canvas.

To complete the assignment, upload here to Canvas by 11:59pm on October 7, 2019.

It’s best if the final knitted document is clean and free of warnings and messages (so if a chunk is creating messages, like wherever you run library(tidyverse), add message=FALSE, warning=FALSE to the chunk options).