I'm trying to create a 3x4 grid of bins with a count of observations from my data in each bin. I'm halfway there:
library(ggplot2)
type <- c('daily', 'daily', 'habit', 'habit', 'habit', 'seasonal', 'seasonal', 'year-long', 'year-long', 'year-long', 'year-long', 'year-long')
status <- c('complete', 'incomplete', 'push', 'push', 'incomplete', 'complete', 'complete', 'complete', 'complete', 'push', 'push', 'incomplete')
results <- data.frame(type, status)
ggplot(results) +
geom_dotplot(aes(x=status, y=type), binwidth=.2) +
facet_grid(vars(type))
Clearly the y-axis is meaningless right now - I'm not sure if geom_dotplot
is the right thing to use. I can get similar results with geom_histogram
or geom_bar
as well.
I'd like dots to start in the upper left corner of each bin. Is this possible? I've tried to use the waffle
package but can't figure it out. Ideally each dot will be a square, which isn't possible using geom_dotplot
, so I'd prefer to use waffle
if I can.