solution house <- read.table("house.txt", header=TRUE, sep=";", stringsAsFactors=FALSE, dec=".") subset <- data[data$Date %in% c("1/2/2007","2/2/2007") ,] str(subset) globalActivePower <- as.numeric(subSetData$Global_active_power) png("plot1.png", width=480, height=480) hist(globalActivePower, col="red", main="Global Active Power", xlab="Global Active Power (kilowatts)") dev.off()