-
Notifications
You must be signed in to change notification settings - Fork 1
/
StateReport.Rmd
84 lines (65 loc) · 2.13 KB
/
StateReport.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
title: "State Report"
output:
html_document: default
pdf_document: default
date: "`r format(Sys.time(), '%d %B, %Y')`"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r include=FALSE}
source('R/StateReportCalcs.R')
source('R/permillgraphfunc.R')
ac <- "AL"
state <- abbr2state(ac)
```
##State Metrics
The below table shows an overview of fatal encounters for the state. Counts expresses the total number of fatal encounters, which is shown in the table for 2017 and for the total between 2000-2017. Capita is the number of fatal encounters per million people in the state's population and includes the value for 2017 as well as the average since 2000. The state is then given a rank for each measure as it is compared with other states (1 is the highest).
```{r, echo=FALSE}
library(knitr)
table_metrics(ac)
```
<style>
.column-left{
float: left;
width: 50%;
text-align: left;
}
.column-right{
float: right;
width: 50%;
}
</style>
<div class="column-left">
##Highest 10 Cities by Counts
```{r, echo=FALSE}
f_years(ac)
```
The above bar graph shows a comparison of the 10 cities with the highest counts of fatal encounters.
##Fatal Encounters over Time
```{r, echo=FALSE}
permillgraph(state, all=TRUE, capita=TRUE)
```
##Counts by Gender
```{r, echo=FALSE}
perGender(ac)
```
Above is the breakdown of counts by gender, and to the right is the breakdown of counts by age group.
</div>
<div class="column-right">
##Choropleth of Counties
```{r, echo=FALSE}
statemap(ac)
```
The above map shows a choropleth of total fatal encounters by county. Counties which are red have higher values while pale colored counties have lower values, and grey counties don't have data.
##Counts by Race
```{r, echo=FALSE}
perRace(ac)
```
Above is the breakdown by race, notice that the highest number is "Race Unspecified" due to the high number of missingness we can't properly understand the true ditribution. Also to be able to properly compare these values we would need to calculate them by capita to see how the counts are relative to the size of the race's population.
##Counts by Age
```{r, echo=FALSE}
perAge(ac)
```
</div>