当我在R终端中尝试以下内容时
library(MASS)
school.fre = painters$School
school.fre = table(school)
cbind(school.fre)
我得到以下结果
> cbind(school.fre)
school.fre
A 10
B 6
C 6
D 10
E 7
F 4
G 7
H 4
但是当我在JRI应用程序中尝试这个时
Rengine re = new Rengine(args, false, new MyTextConsole());
REXP x;
re.eval("library(MASS)");
re.eval("school = painters$School");
re.eval("school.freq = table(school)");
x = re.eval("school.freq");
System.out.println("school.freq::"+x);
x = re.eval("cbind(school.freq)");
System.out.println("\n\ncbind(school.freq)::"+x);
这就是我得到的
school.freq::[INT* (10, 6, 6, 10, 7, 4, 7, 4)]
cbind(school.freq)::[INT* (10, 6, 6, 10, 7, 4, 7, 4)].
我该如何检索结果的第一列(A,B,C ..)?
声明re.eval("barplot(school.freq)");
生成的条形图也很快就消失了。
我非常感谢这方面的任何指导和教程链接,因为我是JRI的新手。