This was generated in 'R' using the following commands:
# Read in data
ted <- read.csv('User/markb/Desktop/Recent_TED.csv')
# Format so TIMESTAMP can be used with POSIXct
ted$time <- as.character( strptime(ted$TIMESTAMP, "%m/%d/%Y %I:%M:%S %p", tz="") )
# Plot the data
plot(as.POSIXct(ted$time),ted$KW, type="l", bty="L", col="red", ylab="Usage (kW)", xlab="Time (each point is second)", ylim=c(0,20), main="Electricity Usage Patterns")
abline(h=0)
# show baseline usage
abline(h=mean(ted$KW[ted$KW < 2]), col="gray")
# add voltage information
par(new=TRUE)
plot(as.POSIXct(ted$time), ted$VRMS, axes=FALSE, bty='L', ylab='', xlab='', type="l", col="gray", ylim=c(100,125))
axis(4)
mtext("Voltage (VRMS, in gray)",4)
abline(h=120, col="gray")
# go to bed
abline(v=as.POSIXct("2009-03-02 22:00:00"), lty=2)
# wake up
abline(v=as.POSIXct("2009-03-03 06:00:00"), lty=2)
No comments:
Post a Comment