-
Notifications
You must be signed in to change notification settings - Fork 0
/
Calls_per_hr.Rmd
59 lines (42 loc) · 1.52 KB
/
Calls_per_hr.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
---
title: "Calls per Hour"
author: "T. Poole"
date: '2022-05-25'
output:
html_document:
code_fold: hide
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r, include=FALSE}
#load packages#
library("tidyverse")
```
### Preamble
This is an analysis displaying the frequency of call volume by hour of the day
at the South Burlington Fire Department for a six year period 2016-2021.
```{r}
#### Import data and remove non-essential fields/variables ####
Calls_2016_2021.df <- read.csv(file = "pivot20162021.csv",header = TRUE, na.strings=c("", "NA"),sep = ",")
#### change hour of day variable to a factor ####
Calls_2016_2021.df$hour <- as.factor(Calls_2016_2021.df$hour)
```
--------------------------------------------------------------------------------
**pivot20212016.csv: data file queried from Fire House database**
**Description:** The data comprises SBFD run data including fields of the Nfirs
basic module plus a number of calculated fields. The hour of day field "hour", is
parsed from the time of call field. The integer is then converted to a factor
variable for this analysis.
**Format:** Calls_2016_2021.df:A dataframe with 22412 observations (calls),
on 86 variables.
--------------------------------------------------------------------------------
#### Call Volume by Hour of the Day:
```{r}
summary.factor(Calls_2016_2021.df$hour)
```
The Bar chart displays the breakdown:
```{r}
Calls_2016_2021.df$hour %>%
qplot(colour = I("red"))
```