我的任务是将使用图形包的代码更改为具有相同结果的bwplot
from包。lattice
箱形图:
par(mai = c(1, 1, 1, 1), omi = c(0, 0, 0, 0))
set.seed(591)
xx1 <- rnorm(20, mean = 3, sd = 3.6)
xx2 <- rpois(40, lambda = 3.5)
xx3 <- rchisq(31, df = 5, ncp = 0)
box1 <- boxplot(xx1, xx2, xx3, names = c("Group-1", "Group-2", "Group-3"), cex = 0.7)
不幸的是,当我尝试更改它时,我无法将这 3 个图插入 1 个图表中。到目前为止我所做的一切:
library(lattice)
bwplot(xx1,ylab="Group-1")
bwplot(xx2,ylab="Group-2")
bwplot(xx3,ylab="Group-3")