How can I split a beeswarm plot by group, similar to this: Split violin plot with ggplot2
But instead of density plots, I would like to get points...
The "calculating the density approach" as suggested by @axeman in the linked question does obviously not work, because beeswarm doesn't use densities.
#Desired output:
require(ggplot2)
require(ggbeeswarm)
my_dat <- data.frame(x = 'x', m = rep(c('a','b'),100), y = rnorm(200))
ggplot(my_dat, aes(x,y))+ geom_quasirandom(method = 'smiley')
Desired output something like:
- The resulting plot was edited with Adobe illustrator, in order to show what I want to get...
- The points in the central axis should rather be dodged to the left/right too, depending on the group.
Edit
a better way to achieve what I want is to use method = 'pseudorandom'
instead of 'smiley'. see
Split beeswarm 2.