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
18 lines (8 loc) · 776 Bytes
/
plot1.R
File metadata and controls
18 lines (8 loc) · 776 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
system ("head -1 /home/kevin/project1/household_power_consumption.txt > /home/kevin/project1/filteredData")
system ( "grep -w \"1/2/2007\" /home/kevin/project1/household_power_consumption.txt >> /home/kevin/project1/filteredData", intern = FALSE)
system ( "grep -w \"2/2/2007\" /home/kevin/project1/household_power_consumption.txt >> /home/kevin/project1/filteredData", intern = FALSE)
system("dos2unix /home/kevin/project1/filteredData")
data <- read.csv ( "/home/kevin/project1/filteredData", sep=";", header=TRUE)
png(filename = "/home/kevin/project1/plot1.png")
hist (data$Global_active_power,breaks=13,main="Global Active Power", xlab = "Global Active Power (kilowatts)", freq = T, col = "red", ylim= c(0,1200), xlim=c(0,6))
dev.off() # this writes the file.