我在R中使用beeswarm
包,并且在自定义单个数据点时遇到一些问题。我正在使用以下数据和代码。
library(beeswarm)
df <- data.frame(x = c(LETTERS), y = "1",
z = c(rnorm(26, 11, 4)))
beeswarm(z ~ y, data = df,
pwcol = c(1, rep(2, 25)), pwpch = c(1, rep(2, 25)), corral = "wrap", method = "center",
xlab = "", ylab = "variable", las=1
)
我想对此进行更改,以便:
有人可以帮忙吗?谢谢。
答案 0 :(得分:2)
您快到了,您只需要进行一些小改动:
library(beeswarm)
df <- data.frame(x = c(LETTERS), y = "1",
z = c(rnorm(26, 11, 4)))
beeswarm(z ~ y, data = df,
pwcol = c("black", rep("grey15", 25)),
pwpch = c(23, rep(1, 25)),
pwbg = c("red", rep("transparent", 25)),
corral = "wrap", method = "center",
xlab = "", ylab = "variable",
las=1
)