Chapter 8 Shiny App and NYC 311 Data

8.1 Introduction

The purpose of this chapter was to create my own shiny app and explore the NYC 311 data set. In this app I explored the agency and complaint types, and the location of the complaints. ## 311 Data Expoloration Continued Today we are expanding our exploration of the NYC 311 dataset and shiny app!

8.2 Loading our libraries

Here we are going to make sure that all of our libraries are loaded

library(shiny)
library(tidyverse)
library(nycOpenData)
library(DT)

8.3 Now we are calling the data

We are also looking at the agency names.

data_311<- nyc_311(limit=10000)
View(data_311)
unique(data_311$agency_name)
##  [1] "New York City Police Department"                    "Department of Parks and Recreation"                
##  [3] "Department of Sanitation"                           "Taxi and Limousine Commission"                     
##  [5] "Economic Development Corporation"                   "Department of Health and Mental Hygiene"           
##  [7] "Department of Transportation"                       "Department of Consumer and Worker Protection"      
##  [9] "Department of Housing Preservation and Development" "Department of Environmental Protection"            
## [11] "Department of Homeless Services"                    "Office of the Sheriff"                             
## [13] "Department of Education"                            "Office of Technology and Innovation"               
## [15] "Department of Buildings"

8.4 Inputs and Outputs

Now we are looking at the top 30 complaints from each agency type.

8.5 Embedded Application

Shiny applications not supported in static R Markdown documents

8.6 Conclusion

We can see that the agency with the most compaint types is the Department of Sanitation. There are some agencies that don’t show any data on the type of complaints which may be an error in the coding or that they don’t have any recorded complaints.