R-可视化--ggbeeswarm绘制蜂群图
1 2 3 library(ggplot2) # install.packages("ggbeeswarm") library(ggbeeswarm) 0、示例数据 1 2 3 4 5 6 7 8 9 10 11 12 13 14 set.seed(1995) y <- round(rnorm(200), 1) df <- data.frame(y = y, group = sample(c("G1", "G2", "G3"), size = 200, replace = TRUE)) head(df) # y group # 1 1.1 G3 # 2 -0.3 G2 # 3 0.1 G2 # 4 0.4 G1 # 5...