1

运行以下代码时,我没有得到预期的结果。我希望在一个窗口中获取所有图(当我执行更简单的操作时它可以工作plot(1:5)),但只有最后一个图出现在左上角。

为什么会发生这种情况,我怎样才能获得所需的行为?

library(psych)
swiss2<-swiss[c(2:6)]
rotations <- c("none", "varimax", "quatimax", 
               "promax", "oblimin", "simplimax")

par(mfrow=c(2,3))
for (current_rotation in rotations){
  biplot(principal(swiss2, nfactors = 2, rotate = current_rotation, scores = T), 
         main = current_rotation)
}

windows()注意:我用和尝试了不同的图形设备x11()。同样的问题。

4

2 回答 2

2

这是 biplot.psych 中的一个微妙错误。

我在 biplot.psych 的出口处将图形参数重置为原始设置。我已对此进行了修改以保留 op <- par(mfrow=c(2,3)) #或任何设置。

一般来说,如果您发现 psych 中的错误,如果您让我知道,我会更快地修复它。

账单

于 2013-06-09T17:14:56.827 回答
0

好吧,它在这里工作得很好。

我的第一次尝试失败并出现以下错误消息:

Loading required package: GPArotation
Erreur dans principal(swiss2, nfactors = 2, rotate = current_rotation, scores = T) (depuis #2) :
  I am sorry, to do these rotations requires the GPArotation package to be installed
De plus : Message d'avis :
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called ‘GPArotation’

你有GPArotation安装包吗?

在此处输入图像描述

于 2013-02-14T09:23:13.217 回答