Git Product home page Git Product logo

exploratory-analysis-course-project-2's Introduction

Link to Github Repo

Introduction

Fine particulate matter (PM2.5) is an ambient air pollutant for which there is strong evidence that it is harmful to human health. In the United States, the Environmental Protection Agency (EPA) is tasked with setting national ambient air quality standards for fine PM and for tracking the emissions of this pollutant into the atmosphere. Approximatly every 3 years, the EPA releases its database on emissions of PM2.5. This database is known as the National Emissions Inventory (NEI). You can read more information about the NEI at the EPA National Emissions Inventory web site.

For each year and for each type of PM source, the NEI records how many tons of PM2.5 were emitted from that source over the course of the entire year. The data that you will use for this assignment are for 1999, 2002, 2005, and 2008.

Data handling

Data for Assessment [29Mb]
The zip file contains two files:

  1. PM2.5 Emissions Data (summarySCC_PM25.rds): This file contains a data frame with all of the PM2.5 emissions data for 1999, 2002, 2005, and 2008. For each year, the table contains number of tons of PM2.5 emitted from a specific type of source for the entire year.
  • fips: A five-digit number (represented as a string) indicating the U.S. county
  • SCC: The name of the source as indicated by a digit string (see source code classification table)
  • Pollutant: A string indicating the pollutant
  • Emissions: Amount of PM2.5 emitted, in tons
  • type: The type of source (point, non-point, on-road, or non-road)
  • year: The year of emissions recorded
  1. Source Classification Code Table (Source_Classification_Code.rds): This table provides a mapping from the SCC digit strings in the Emissions table to the actual name of the PM2.5 source. The sources are categorized in a few different ways from more general to more specific and you may choose to explore whatever categories you think are most useful. For example, source “10100101” is known as “Ext Comb /Electric Gen /Anthracite Coal /Pulverized Coal”.

How the Source Classification Codes were determined for Plots 3-6:

This snippet of code is only for filtering on Coal Combustion (Plot 4).

# Levels go from generic (SCC.Level.One) to specific (SCC.Level.Four)
# data only exists for "coal" in the SCC.Level.Four and SCC.Level.Three and EI.Sector
# After analysis, Short.Name by "comb" and SCC.Level.Four by "coal" 

# Uncomment to see the unique values in Short.Name and SCC.Level.Four BEFORE filtering
# print(unique(SCC[grepl("coal|comb",SCC$Short.Name, ignore.case=TRUE),]$Short.Name)))
# print(unique(SCC[grepl("coal",SCC$Short.Name, ignore.case=TRUE),]$Short.Name)))

# Filter on Short.Name
data_coal_comb <- SCC[grepl("coal|comb",SCC$Short.Name, ignore.case=TRUE),]

# Filter again on SCC.Level.Four
scc_list <- data_coal_comb[grepl("coal",data_coal_comb$SCC.Level.Four, ignore.case=TRUE),]

# Uncomment to see what was filtered out the second time
# d <- setdiff(data_coal_comb, scc_list)
# unique(d$Short.Name)

# Take SCC codes we grepped for and pull NEI data containing the SCC code
# filteredNEI data is ready for plotting
filteredSCC <- SCC[scc_list$SCC,]$SCC
filteredNEI <- NEI[NEI$SCC %in% filteredSCC,]

Plots and Analysis

Plot 1

Question: Have total emissions from PM2.5 decreased in the United States from 1999 to 2008? Using the base plotting system, make a plot showing the total PM2.5 emission from all sources for each of the years 1999, 2002, 2005, and 2008.

Analysis: The total PM2.5 emissions across the United States has decreased from 1999 to 2008. The total emissions stabilized from 2002 to 2005 but significantly decreased from 2005-2008.

plot1

Plot 2

Question: Have total emissions from PM2.5 decreased in the Baltimore City, Maryland (fips=="24510") from 1999 to 2008? Use the base plotting system to make a plot answering this question.

Analysis: Ultimately, emissions in Baltimore City, MD have decreased from 1999 to 2008 but it was not a stable decrease in emissions with a spike in 2005.

plot2

Plot 3

Question: Of the four types of sources indicated by the type (point, nonpoint, onroad, nonroad) variable, which of these four sources have seen decreases in emissions from 1999–2008 for Baltimore City? Which have seen increases in emissions from 1999–2008? Use the ggplot2 plotting system to make a plot answer this question.

Analysis: Emissions from on-road, non-point, and on-road sources all significantly decreased from 1999 to 2008. The only source that increased emissions slightly was from the point source.

plot3

Plot 4

Question: Across the United States, how have emissions from coal combustion-related sources changed from 1999–2008?

Analysis: Emissions across the United States related to coal combustion has decreased from 1999 to 2008.

plot4

Plot 5

Question: How have emissions from motor vehicle sources changed from 1999–2008 in Baltimore City?

Analysis: Emissions in Baltimore City, MD related to motor vehicle sources has steadily decreased from 1999 to 2008.

plot5

Plot 6

Question: Compare emissions from motor vehicle sources in Baltimore City with emissions from motor vehicle sources in Los Angeles County, California (fips=="06037"). Which city has seen greater changes over time in motor vehicle emissions?

Analysis: Emissions related to motor vehicle sources in Baltimore City vs Los Angeles has stark differences. Emmissions from Los Angeles heavily over power emissions from Balitimore City. Los Angeles has not decreased motor vehicle emissions at all from 1999 to 2008 while Baltimore City decreased emissions by over half.

plot6

exploratory-analysis-course-project-2's People

Contributors

witcheswhocode avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.