Project 1 - Just breathe
Project 1 - Just breathe
Link to the shiny app is: https://abhishek-v.shinyapps.io/Just-Breathe/
Github repository: https://github.com/abhishek-v/Air-pollution-data
Instructions in using the Shiny app:
Download the repository from Github as a zip file. Extract it into any folder. Open the R code on R studio. You can run it either locally or publish it on Shiny apps.
All colors chosen are from http://colorbrewer2.org . All these colors are marked as color-blind safe
Single county mode
In this mode, you can view the plots for a single selected county. You need to choose the "Single county mode" dropdown in the sidebar and choose the year,state and county. We have 4 tabs in this mode:
AQI details: This tab shows the table and bar chart showing number of polluted days, pie chart showing percentage of polluted days and finally graph showing median, maximum and 90th percentile AQI over the years.
Pollutants overview: This tab has table and graph with details of each pollutant over the years. It also has a bar chart showing number of days of each pollutant for the selected year.
Individual pollutants: This tab shows percentage number of days for each pollutant for selected year.
County overview: This tab shows the map for the selected county if the latitude and longitude are known.
Search feature: The sidebar has a text field where you can type in the county name and narrow down the list of counties for the current selected state. (I've noticed cases where search causes the app to crash, please refresh page if this happens)
In this mode, you can compare plots for each of the three selected counties. You need to choose the "Comparison mode" dropdown in the sidebar and choose the year,state and county for all three counties. We have 4 tabs in this mode:
AQI index: This tab shows the table and bar chart showing number of polluted days for each of the selected counties. Hence, we have three tables and three bar plots in total.
Pollutants overview: This tab shows the major pollutant over the years for all three selected counties. It can also show the AQI index over the years for the three counties.
Individual pollutants: This tab shows percentage number of days for current selected pollutant(use dropdown to change the pollutant) for selected year for each of the three counties.
About app: This tab shows information about the libraries used in building the app.
This app uses Air Quality data obtained from the US Environmental Protection Agency's website. (EPA)
The data is stored as a list of dataframes. List element is the state and each state is linked to a dataframe containing all counties it has.
Pollution stats in Illinois
The charts above show comparsion between the following counties: Cook, Will and Tazewell. These counties are at an increasing distance from the city (Chicago). It is not surprising to see that Cook county where Chicago is located has the most number of polluted days. Will county which is in the outskirts of Chicago has moderately polluted days, but less than what Cook county experiences. Tazewell which is in the center of Illinois, away from the city has no polluted days.
Pollution stats between major cities
The charts above show comparsion between the cities of Chicago, New York and Los Angeles for the year 2018. Not so surprisingly, Los Angeles has the most number of polluted days. Chicago comes in second and New York has the least polluted days among the three. This is perhaps because of New York's better public transportation services.
Pollution stats in Honolulu, Hawaii:
A quick google search provided Honolulu as the least polluted place in the US. This is evidenced by the chart above which shows Honolulu's stats for the year 1980. For the year 2018, we see similar stats with just a few days in the moderate level and rest classified as good days.
Ozone level in Chicago, Cook county:
The city of Chicago has apparently been seeing rising levels of Ozone according to the news. This is confirmed by the graph shown above where ozone consistently increases over the years. We also see a sharp spike in the levels of PM2.5