diff --git a/Plot1.R b/Plot1.R index 24d0a07c2c7..55bffe3671a 100644 --- a/Plot1.R +++ b/Plot1.R @@ -7,4 +7,27 @@ df$DateTimeTemp <- paste(df$Date,df$Time) #convert to date time (for some reason required two steps to work) df$DateTime <- strptime(x = as.character(df$DateTimeTemp), format = "%d/%m/%Y %H:%M:%S") # drop extra columns -#drops <- c(Daf, select = c("Global_active_DateTime","power","Global_reactive_power","Voltage", "Global_intensity","Sub_metering_1","Sub_metering_2","Sub_metering_3")) \ No newline at end of file +df <- subset(df, select = c("DateTime","Global_active_power","Global_reactive_power","Voltage", "Global_intensity","Sub_metering_1","Sub_metering_2","Sub_metering_3")) +#2007-02-01 and 2007-02-02 +#probably could have subset earlier, but needed to move on. +feb <- subset(df, df$DateTime > "2007-01-31 23:59:59" & df$DateTime < "2007-02-03") +#remove giant dataframe +rm(df) +#show head of feb just to check +head(feb) + + +#view it on screen +dev.off(dev.list()["RStudioGD"]) +dev.set(2) +dev.cur() +hist(feb$Global_active_power,col="red",main="Global Active Power", xlab="Global Active Power (kilowatts)") + +#write to png +dev.off(dev.list()["RStudioGD"]) +png("Plot1.png", wi/Users/mooncalf/Dropbox/skb/coursera/ExData_Plotting1/pUsers/mooncalght = 480) +hist(feb$Global_active_power,col="red",main="Global Active Power", xlab="Global Active Power (kilowatts)") +dev.off() + + + diff --git a/Plot1.png b/Plot1.png new file mode 100644 index 00000000000..b5ef6a7df4a Binary files /dev/null and b/Plot1.png differ