-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot1.R
33 lines (26 loc) · 878 Bytes
/
plot1.R
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
#carregando todos os dados da tabela
data_full <- read.csv("household_power_consumption.txt", header=T, sep=';', na.strings="?",nrows=2075259, check.names=F, stringsAsFactors=F, comment.char="", quote='\"')
data_full$Date <- as.Date(data_full$Date, format="%d/%m/%Y")
## Dados apenas de 2007-02-01 and 2007-02-02
data <- subset(data_full, subset=(Date >= "2007-02-01" & Date <= "2007-02-02"))
rm(data_full)
## Convertendo as datas
datetime <- paste(as.Date(data$Date), data$Time)
data$Datetime <- as.POSIXct(datetime)
## Plot numero 1
hist(data$Global_active_power, main="Global Active Power",
xlab="Global Active Power (kilowatts)", ylab="Frequency", col="Red")
## Salvando
dev.copy(png, file="plot1.png", height=480, width=480)
dev.off()
Status
API
Training
Shop
Blog
About
© 2014 GitHub, Inc.
Terms
Privacy
Security
Contact