Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plot1.R #612

Open
alejandra1502 opened this issue Jan 13, 2016 · 0 comments
Open

plot1.R #612

alejandra1502 opened this issue Jan 13, 2016 · 0 comments

Comments

@alejandra1502
Copy link

'

'

'Code for plot1: Global Active Power vs. Frecuency

'

'Author: Alejandra Alvarez

'

'

setwd('Working directory')

hpc <- read.table('household_power_consumption.txt', sep = ";", header=TRUE)

hpcD1 <- subset(hpc, Date == '1/2/2007')
hpcD2 <- subset(hpc, Date == '2/2/2007')

hpcD <- NULL
hpcD <- rbind(hpcD, hpcD1, hpcD2)

Global_active_power <- as.numeric(as.character(hpcD$Global_active_power))

png("plot1.png" , width = 480, height = 480)
hist(Global_active_power, col = "red", xlab = "Global Active Power (kilowatts)", main = "Global Active Power", yaxt = "n")
axis(2,seq(0,1200, by = 200))
dev.off()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant