我正在尝试绘制 ggplot 矩阵,箱线图版本工作得很好,但是当我尝试对 ggplot 做同样的事情时,我惨遭失败
箱线图版本:
par(mfrow=c(3, 3))
for (scale in c("POMS",
"POMS_post",
"DERS",
"DERS_post",
"REAPPRAISAL",
"REAPPRAISAL_POST",
"NEGATIV",
"NEGATIVE_POST")) {
boxplot(kata1[, scale] ~ Skupina, data=kata1, ylab=scale)
}
ggplot 版本:
# Testing
for (scale in c("POMS",
"POMS_post",
"DERS",
"DERS_post",
"REAPPRAISAL",
"REAPPRAISAL_POST",
"NEGATIV",
"NEGATIVE_POST")) {
ggally_box(kata1, aes(Skupina, kata1[, scale])) # This does not work...
}
我认为这不应该那么困难,但我被卡住了。
谢谢你的帮助!