forked from rdpeng/ExData_Plotting1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot1.R
More file actions
19 lines (14 loc) · 623 Bytes
/
plot1.R
File metadata and controls
19 lines (14 loc) · 623 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
## plot1.R
## Read The Full Data into a Data Frame
epcdata <- read.csv("./data/household_power_consumption.txt",sep=";",
na.strings="?")
## Extract data for 1st and 2nd of February 2007
usedata <- subset(epcdata, Date == "1/2/2007" | Date == "2/2/2007")
## Initialize plot parameters
par(mar=c(6,4.5,3.5,2),cex=0.75)
## Plot Histogram of Global Active Power
with(usedata, hist(Global_active_power, col="red",main="Global Active Power",
xlab="Global Active Power (kilowatts)"))
## Save as a PNG File
dev.copy(png,file="plot1.png",width = 480, height = 480, units = "px")
dev.off()