I have the following data:
> Data
Date Start End
1 2011-11-15 12:01:27 12:30:15
2 2011-11-16 12:01:25 12:32:15
3 2011-11-17 12:01:02 12:39:12
4 2011-11-19 12:01:12 12:30:18
to which I've also appended a Duration column
Data[,4] <- as.numeric(difftime(Data$End,Data$Start))
names(Data)[4] <- "Duration"
I have in my head a visualization for Start,End that looks kind of like a stock candlestick or OHLC chart, where the x value is the Date, and y is End - Start.
End is at the top with a rectangle descending down to Start---the height of the rectangle changes over time with the Duration. That is, each Date has a different rectangle height determined by the difference between Start and End.
The x axis, here, goes from 2011-11-15 to 2011-11-19. The y axis goes from 12:00:00 to 12:40:00.
Do any ggplot wizards see an easy way to do this? Since both Start and End are changing over time, would I have to use geom_ribbon or geom_polygon rather than geom_bar or geom_area?
It would be extra cool if the color of the bar can change to red on days when the value of Duration is greater than 2 standard deviations!