Error: ggplot2 doesn't know how to deal with data of class uneval
目录
Error: ggplot2 doesn't know how to deal with data of class uneval
使用美国中西部电力市场“最近”每小时风力发电数据进行可视化分析。
期望用红色覆盖最近两天的观察值,结果发生了错误。
#问题
# Read in Wind data
fname <- "https://www.midwestiso.org/Library/Repository/Market%20Reports/20130510_hwd_HIST.csv"
df <- read.csv(fname, header=TRUE, sep="," , skip=7)
df <- df[1:(length(df$MKTHOUR)-5),]
# format variables
df$MWh <- as.numeric(df$MWh)
df$Datetime <- strptime(df$MKTHOUR, "%m/%d/%y %I:%M %p")
# Create some variables
df$Date <- as.Date(df$Datetime)
df$HrEnd <- df$Datetime$hour+1
# Subset recent and last data
la