From 6f68711af15f102151a92bcd9eadb185847c6cff Mon Sep 17 00:00:00 2001 From: Benz620 <155933031+Benz620@users.noreply.github.com> Date: Sat, 13 Jan 2024 16:18:47 -0500 Subject: [PATCH] Create plot1.R --- plot1.R | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 plot1.R diff --git a/plot1.R b/plot1.R new file mode 100644 index 00000000000..20596f7aa23 --- /dev/null +++ b/plot1.R @@ -0,0 +1,13 @@ +png("plot1.png",width = 480,height=480) + +#Loading the data , as you can see, I didnt need the strptime +#or the as.Date function(for now!) +data<- read.delim("household_power_consumption.txt",sep = ";") +library(data.table) +data<-data.table(data) +data1 <- data[Date%in%c("1/2/2007","2/2/2007"),] + +View(data1) +data1$Global_active_power<-as.numeric(data1$Global_active_power) +hist(data1$Global_active_power,col = "red", xlab = "Global active power (kilowatts)",main = "Global active power") +dev.off()