在Eclipse和R中的StatET [英] StatET in Eclipse and R

查看:446
本文介绍了在Eclipse和R中的StatET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设法将StatET安装到eclipse中,我有一个名为Test的Java项目,其中包含一些代码。我希望能够将.R文件保存在该项目文件夹中,并将其作为独立的R脚本运行,与Java程序分开。我该怎么做?如果我尝试突出显示.R文件中的一些R代码并运行它,它说在当前工作台窗口中没有R的活动。



更新:
我添加了一个运行配置,我现在在弹出框中出现以下错误,当我尝试运行R脚本:

 启动R控制台已被取消,因为似乎启动了R引擎失败。 
请确保安装了R包'rj'(1.0.0或兼容),R库路径设置为R环境配置'R'


解决方案

您需要先从Eclipse中启动R控制台。选择运行 - >从菜单栏运行配置... 。如果您尚未创建R配置,则可以通过右键单击 R控制台来创建新配置。欲了解更多信息,Longhow Lam组织了一个不错的指南(PDF)



编辑:
关于您的新错误消息,请确保 rj

安装。包(c(rj,rj.gd),repos =http://download.walware.de/rj-1.0)



对于开发StatET 3.0:



install.packages(c(rj,rj.gd),repos =http://download.walware.de/rj-1.1)



对于旧的StatET 0.10:



install.packages(rj,repos =http://download.walware.de/rj-0.5)


I've managed to install StatET into eclipse, and I have a Java project called "Test" with some code in there. I'd like to be able to keep a .R file in that project folder and run it as a stand alone R script, seperate from the Java program. How can I do this? If I try to highlight some R code in a .R file and run it, it says "No session of R is active in the current workbench window."

Update: I added a run configuration and I now have the following error in a pop up box when I try to run the R script:

Launching the R Console was cancelled, because it seems starting the R engine failed. 
Please make sure that R package 'rj' (1.0.0 or compatible) is installed and that the R library paths are set correctly for the R environment configuration 'R'

解决方案

You need to first start an R console from within Eclipse. Select Run -> Run Configurations... from the menu bar. If you have not already created an R configuration, you can create a new one by right-clicking on R Console. For more information, Longhow Lam put together a nice guide (PDF).

EDIT: Regarding your new error message, make sure rj is installed in R by running one of these commands in the command-line version of R. For the current StatET 2.0:

install.packages(c("rj", "rj.gd"), repos="http://download.walware.de/rj-1.0")

For the development StatET 3.0:

install.packages(c("rj", "rj.gd"), repos="http://download.walware.de/rj-1.1")

For the old StatET 0.10:

install.packages("rj", repos="http://download.walware.de/rj-0.5")

这篇关于在Eclipse和R中的StatET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆