-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot3.R
More file actions
42 lines (33 loc) · 930 Bytes
/
plot3.R
File metadata and controls
42 lines (33 loc) · 930 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#Reference UDFs
source("./udf.R")
#Define function for building the plot png file
plot3 <- function(dframes=NULL){
packages <- c("dplyr","ggplot2")
packagechecks <- checkPackages(packages)
if(is.null(dframes)){
dframes <- loaddata()
}
pmdf <- data.frame(dframes[1])
summary <- data.frame(dframes[2])
#Begin Analysis
summary.baltimore <- transform(subset(summary, summary$fips == "24510"), type = factor(type))
# Set bg color transparent
par(bg = "transparent")
# Start device
png(file = "plot3.png", width=1200, height=800)
# Draw plot 3
print({
g <- qplot(year, Emissions,
data = summary.baltimore,
geom = c("point","smooth"),
method = "lm",
facets = .~type)
g + geom_point() + coord_cartesian(ylim = (c(0,100)))
}
)
# Close the device
dev.off()
#Answer, They all have but nonpoint and point have shown the greatest decreases according to this graph.
}
#Call the Function
plot3()