-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlot2.r
More file actions
14 lines (9 loc) · 787 Bytes
/
Plot2.r
File metadata and controls
14 lines (9 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Data <- readRDS("C:/Users/SUN/Documents/R Studio Scripts/Course4 Project/summarySCC_PM25.RDS")
DataSumm <-readRDS("C:/Users/SUN/Documents/R Studio Scripts/Course4 Project/Source_Classification_Code.RDS")
#Data Frame assigned ---------------------------------------------------------------------------------------
Data$year <- as.factor(Data$year)
BaltimoreSub <- subset(Data, Data$fips == "24510" )
EachYearTot_Baltimore <- aggregate(Emissions ~ year , BaltimoreSub , sum)
png("Plot2.png",width=480,height=480,units="px")
barplot(height = EachYearTot_Baltimore $Emissions ,names = EachYearTot_Baltimore$year, col = " light green ", xlab = " Years ", ylab = expression(' PM'[2.5]*' emission'), main = expression('Total PM'[2.5]*'Emissions Through The Years In Baltimore'))
dev.off()