I think it could be convenient to export the PositionBeeswarm and PositionQuasirandom classes.
This would make it convenient to use a simple position = "beeswarm" in a layer, rather than having to type out position = position_beeswarm() in full.
library(ggbeeswarm)
#> Loading required package: ggplot2
ggplot(mpg, aes(drv, displ)) +
geom_point(position = "beeswarm")
#> Error in `geom_point()`:
#> ! Can't find position called "beeswarm".
# What it should look like
ggplot(mpg, aes(drv, displ)) +
geom_point(position = position_beeswarm())
In addition to exporting the position classes, it would be nice if they have nice pre-populated parameters.
In the example below, we cannot use position = "beeswarm" because there is no default method parameter.
# Simulate export of class
PositionBeeswarm <- ggbeeswarm:::PositionBeeswarm
ggplot(mpg, aes(drv, displ)) +
geom_point(position = "beeswarm")
#> Error in `geom_point()`:
#> ! Problem while computing position.
#> ℹ Error occurred in the 1st layer.
#> Caused by error in `if (method %in% c("swarm", "compactswarm")) ...`:
#> ! argument is of length zero
Hi there,
I think it could be convenient to export the
PositionBeeswarm
andPositionQuasirandom
classes. This would make it convenient to use a simpleposition = "beeswarm"
in a layer, rather than having to type outposition = position_beeswarm()
in full.In addition to exporting the position classes, it would be nice if they have nice pre-populated parameters. In the example below, we cannot use
position = "beeswarm"
because there is no defaultmethod
parameter.Created on 2024-09-20 with reprex v2.1.1