下面acp
的 R 代码中的对象是PCA()
调用的输出。您对错误的原因有任何想法吗?
> library(dynGraph)
Loading required package: rJava
> dynGraph(acp)
Error in .jinit(classpath = paste(dir, "dynGraph.jar", sep = "")) :
Cannot create Java virtual machine (-4)
编辑:下面是一个产生另一个错误的例子:
library(FactoMineR)
library(dynGraph)
D <- scan()
3 -2 -1
2 -1 -3
1 2 -3
-3 1 2
-2 0 3
D <- as.data.frame(matrix(D, byrow=TRUE, ncol=3))
names(D) <- c("x","y","z")
rownames(D) <- LETTERS[1:nrow(D)]
acp <- PCA(D,
scale.unit=FALSE,
ncp=2, graph=FALSE)
dynGraph(acp)
> dynGraph(acp)
Error in .jcall(obj, , "addVal", annot[1, 1], tab) :
java.lang.AbstractMethodError: org.apache.xerces.dom.DeferredTextImpl.getTextContent()Ljava/lang/String;
编辑:事实上 dynGraph 与前面的例子配合得很好,只需键入:
dynGraph(D)
所以我怀疑错误是由于不良做法造成的?
编辑:下面是 sessionInfo() 输出:
> sessionInfo()
R version 2.15.1 (2012-06-22)
Platform: i386-pc-mingw32/i386 (32-bit)
locale:
[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] dynGraph_1.05 rJava_0.9-3 FactoMineR_1.20 scatterplot3d_0.3-33 cluster_1.14.2
[6] lattice_0.20-10 ellipse_0.3-7
loaded via a namespace (and not attached):
[1] grid_2.15.1 tools_2.15.1