Though ggbeeswarm is not designed to plot a single point, it should handle it with no errors. Here is a reprex, which generates an error:
library(ggplot2)
library(ggbeeswarm)
df <- data.frame(x = 1, y = 1)
ggplot(df, aes(x = x, y = y)) + geom_beeswarm(priority = "density")
#> Error in `geom_beeswarm()`:
#> ! Problem while computing position.
#> ℹ Error occurred in the 1st layer.
#> Caused by error in `density.default()`:
#> ! need at least 2 points to select a bandwidth automatically
This only happens when priority = "density", other priorities are handled correctly.
Though
ggbeeswarm
is not designed to plot a single point, it should handle it with no errors. Here is a reprex, which generates an error:This only happens when
priority = "density"
, other priorities are handled correctly.