I am looking to create two separate plots for weekdays and weekends from my time-series data set
I have two sets of data, one for temperatures and one for load around a substation. I have averaged them over day intervals Using the mutate and wday functions I have turned each day into days of the week eg. "Mon, Tue" etc. I am having trouble plotting it in ggplot. I am pretty new to R so it might be a simple fix.
#For weekend plot
date <- as.POSIXlt(BDR1DM$day, format = "%Y-%m-%d")
df %>%
select(day, SSLoad) %>%
mutate(weekend = wday(day, label = TRUE)) %>%
filter(wday(day) %in% c(1,7))
day <- as.POSIXlt(HDDsumSS$date, format = "%Y-%m-%d")
date$wday
#day of week for Temp data
dt %>%
select(date, Temp) %>%
mutate(weekend = wday(day, label = TRUE)) %>%
filter(wday(day) %in% c(1,7))
ggplot() +
aes(x= dt$Temp, y= df$SSLoad)+
geom_point(data = subset(df, dayofweek$weekend == c("Sat", "Sun")))
I'm not sure if I am using the subplot right in the ggplot. Does anyone know how to plot for, in this case, weekends only.