1

I use org.rosuda.jri lib to run an R script that implements the ordinary kirging algorithm via java. I use ubuntu 13.04 and the version 1.7-3 of REngine While all the results are perfectly produced BUT i can not create the plots and store them.

while the following lines are perfectly executed in R console

png('/home/panisis/Desktop/plots/tralala.png');
spplot(df);
dev.off();

These ones are ignored

re.eval("png('/home/panisis/Desktop/plots/tralala.png');"); 
re.eval("spplot(df);");
re.eval("dev.off();");

What i am missing??? Thanks for the dedicated time. :-)

4

1 回答 1

0

我自己找到了答案。我把它放在这里供下一个用户使用。我必须将绘图分配给一个临时变量(例如 temp <- spplot()),然后使用 print(temp) 将其保存为 png 文件,例如 temp <- spplot() png(filename="pathToFile") print(临时)dev.off()

于 2018-12-07T12:56:45.113 回答