From f9db8a69c0e4108c6b6d7c0f96f2a18d6736d637 Mon Sep 17 00:00:00 2001 From: Sherrod Blankner Date: Sun, 18 Sep 2016 14:51:59 -0700 Subject: [PATCH] got data set up --- Plot1.R | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Plot1.R diff --git a/Plot1.R b/Plot1.R new file mode 100644 index 00000000000..24d0a07c2c7 --- /dev/null +++ b/Plot1.R @@ -0,0 +1,10 @@ +df <- read.csv("/Users/mooncalf/Dropbox/skb/coursera/data/household_power_consumption.txt", sep=";") +#convert the Date and Time variables to Date/Time classes in R using the 𝚜𝚝𝚛𝚙𝚝𝚒𝚖𝚎() and 𝚊𝚜.𝙳𝚊𝚝𝚎()functions. + +#df$Date <- strptime(x = as.character(df$Date), format = "%d/%m/%Y") +# temp column with date time +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