2

我正在使用 JRI 包来构建使用 catR 包的应用程序。在我的 Mac 上完美运行,但是当我在 Windows 上尝试时,函数 thetaEst 总是返回 null - 只有这个函数。是否有任何特定于 Windows 的配置..?

这是一段代码:

re.eval("ibsize                 <- 38");
re.eval("responses              <- c(" + resp + ")");
re.eval("discrimination         <- sample(1, ibsize, replace=T)");
re.eval("difficulty             <- c(3.64,  2.42,  2.16,  2.42, 1.64, 1.51, 1.16, -0.95, 1.40, -0.90, 0.31, 1.17, 0.63, 1.22, -0.74, -0.71, -0.74, -0.66, -0.79, 0.03, 1.60, 0.26,  -0.15,  1.81, 1.17, 0.50, -0.04, 1.93, 0.97, -0.04, 3.44, 0.23, 0.05, 3.64, 1.47, 2.08, 3.34, 1.00)");
re.eval("guessing               <- sample(0, ibsize, replace=T)");
re.eval("inattention            <- sample(1, ibsize, replace=T)");
re.eval("itemBank               <- cbind(discrimination, difficulty, guessing, inattention)");
REXP theta = re.eval("thetaEst(itemBank, responses, method = \"EAP\", parInt = c(-3.64, 3.64, 99))");
System.out.println("theta = "+ theta.asDouble());

我在 theta.asDouble() 上得到了 NullPointerException;

任何人都可以帮助我吗?

提前致谢。

4

1 回答 1

0

检查 ibize 和其他整数值

您可能需要明确地说它是这样的整数

ibsize <- 38L

于 2015-06-07T15:02:32.803 回答