FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
ProgrammingAssignment/plot1.R at master · Nr6/ProgrammingAssignment · GitHub
Nr6
/
ProgrammingAssignment
Public
forked from
rdpeng/ProgrammingAssignment2
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
ProgrammingAssignment
/
plot1.R
Copy path
More file actions
More file actions
Latest commit
History
History
History
22 lines (17 loc) · 791 Bytes
Breadcrumbs
ProgrammingAssignment
/
plot1.R
Copy path
File metadata and controls
22 lines (17 loc) · 791 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Date1
<-
strptime(
"
01/02/2007
"
,
"
%d/%m/%Y
"
)
#
first date in data to analyse
Date2
<-
strptime(
"
02/02/2007
"
,
"
%d/%m/%Y
"
)
#
second date in data to analyse
#
# Read whole data
data
<-
read.csv2(
"
household_power_consumption.txt
"
,
stringsAsFactors
=
FALSE
,
na.strings
=
"
?
"
)
#
# use only data for specified dates
data
<-
data
[strptime(
data
$
Date
,
"
%d/%m/%Y
"
)
==
Date1
|
strptime(
data
$
Date
,
"
%d/%m/%Y
"
)
==
Date2
,]
png(
file
=
"
plot1.png
"
)
#
# open png device
hist(as.double(
data
$
Global_active_power
),
#
# convert text to double
main
=
"
Global Active Power
"
,
#
# main heading
xlab
=
"
Global Active Power (kilowatts)
"
,
#
# x-axis text
ylab
=
"
Frequency
"
,
#
# y-axis text
border
=
NULL
,
#
# no border lines
col
=
"
red
"
)
#
# color of bars
dev.off()
#
# close device
Back
|
FazBrowse Home
|
New Git URL