-
Notifications
You must be signed in to change notification settings - Fork 0
/
MurdersReport1.Rmd
39 lines (29 loc) · 932 Bytes
/
MurdersReport1.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
---
title: "Report on Gun Murders"
author: "Kelsey Bohanon"
date: "`r format(Sys.Date())`"
output:
html_document:
df_print: paged
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## Introduction
This is a report on 2010 gun murder rates obtained from FBI reports. The original data was obtained from [this Wikipedia page](https://en.wikipedia.org/wiki/Murder_in_the_United_States_by_state).
We are going to use the following library:
```{r loading-libs, message=FALSE}
library(tidyverse)
```
and load the data we already wrangled:
```{r}
load("rdas/murders.rda")
```
## Murder rate by state
We note the large state to state variability by generating a barplot showing the murder rate by state:
```{r murder-rate-by-state, echo=FALSE}
murders %>% mutate(abb = reorder(abb, rate)) %>%
ggplot(aes(abb, rate)) +
geom_bar(width = 0.5, stat = "identity", color = "black") +
coord_flip()
```