【发布时间】:2020-02-13 20:14:40
【问题描述】:
我正在使用基本 R 图。
我想创建一个箱线图,其中包含子集值和同一图上的所有值。关键是它必须在基础 R 图中。
Party <- rep(c("Rep", "Dem", "Ind"), 50)
Values <- sample(1:100, size = length(Party), replace = T)
hw <- data.frame(Party, Values)
#Plot 1
boxplot(hw$Values,
col=c("green"),
xlab = "All Respondents")
#Plot 2
boxplot(hw$Values~hw$Party,
col=c("blue", "purple", "red"),
xlab = "Partisan Respondents")
我基本上希望将情节 1 和情节 2 合并为一个情节。
您能提供的任何帮助将不胜感激。谢谢!
【问题讨论】: