I have a data-set similar to this
products <- c('Product1', 'Product2', 'Product3', 'Product3', 'Product1', 'Product1')
timestamp <- c(1,2,3,4,5,6)
categories <- c('Category1', 'Category2', 'Category1', 'Category1', 'Category1', 'Category1')
data <- data.frame(timestamp, products, categories)
Now I would like to draw a dotplot with ggplot2 like so
ggplot(data, aes(timestamp, products, colour=categories, group=categories)) + geom_point()
Which produces the following chart

Which is almost what I what, however, I would like to group the products in categories as they are in this chart:
dotchart(data$timestamp, labels=data$products, groups=data$categories, color=data$color)

It is important to plot occurrences of a product for the same y-value (like in the first plot), instead of repeating it for every record as it is done in the second plot.



+ facet_wrap(~categories)useful to you