We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 73fe5c6 commit 1812ccbCopy full SHA for 1812ccb
plot1.R
@@ -0,0 +1,11 @@
1
+## This program reads a subset of "household_power_consumption.txt" file and creates a histogram
2
+## on the Global_active_power column. The histogram is saved as a .png file named "plot1.png"
3
+
4
5
+input <- read.table("household_power_consumption.txt",skip=66637,nrow=2880,sep=";",
6
+ col.names=colnames(read.table("household_power_consumption.txt",nrow=1,header=TRUE,sep=";")))
7
8
+## create .png file of the histogram
9
+png("plot1.png",width=480,height=480)
10
+hist(input$Global_active_power,main="Global Active Power",xlab="Global Active Power(kilowatts)",ylab="Frequency",col="red")
11
+dev.off() ## Close graphics file
0 commit comments