-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathplot5.R
More file actions
18 lines (14 loc) · 676 Bytes
/
Copy pathplot5.R
File metadata and controls
18 lines (14 loc) · 676 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
library(dplyr)
library(ggplot2)
library(stringr)
NEI <- readRDS("exdata-data-NEI_data/summarySCC_PM25.rds")
SCC <- readRDS("exdata-data-NEI_data/Source_Classification_Code.rds")
vehicleSCC <- filter(SCC, str_detect(SCC.Level.Two, "[Vv]ehicle"))
vehicleNEI <- filter(NEI, SCC %in% vehicleSCC$SCC)
balt_vehicleNEI <- filter(vehicleNEI, fips=="24510")
g5 <- ggplot(balt_vehicleNEI, aes(factor(year), Emissions))
g5 + geom_bar(stat="identity") +
theme_bw(base_family = "Helvetica") +
labs(x="Years", y="Total emissions",
title="Motor Vehicle Sources Emissions in Baltimore from 1999 to 2008") +
ggsave("plot5.png", width = 30, height = 30, units = "cm")