如何在Eclipse的StatET插件中安装'rj' ?

[英]How does one install 'rj' in StatET plugin for Eclipse?


I have started to try to use StatET and Texlipse with a view to producing SWEAVE reports. When starting the R console in the StatET plug-in for Eclipse (OS X 10.6.4), I get the message:

我已经开始尝试使用StatET和Texlipse来制作SWEAVE报告。当在Eclipse的StatET插件(OS X 10.6.4)中启动R控制台时,我得到以下消息:

[INFO] The R package 'rj' is not available, R-StatET tools cannot be initialized.

Information on http://www.walware.de/goto/statet states:

信息在http://www.walware.de/goto/statet上:

"The package only works in the default R Console (RJ) in StatET. Therefore you have to install and update it using the command line":

“该包仅在StatET中的默认R控制台(RJ)中工作。因此,您必须使用命令行来安装和更新它”:

R CMD INSTALL --no-test-load rj_*.tar.gz

What does this mean exactly?

这到底是什么意思?

In Eclipse under "Install new Software" and the site

在Eclipse下“安装新软件”和站点

WalWare - http://download.walware.de/eclipse-3.6

it states that

它指出,

  RJ Core Library 0.5.0.b201008271600sw

is already installed.

已经安装。

Any helpful guidance gratefully received.

感激地接受任何有益的指导。

5 个解决方案

#1


3  

It looks like you need to install the RJ library which can be downloaded from the StatET site here: http://download.walware.de/rj/rj_0.5.0-5.tar.gz (more recent versions of RJ can be found at http://www.walware.de/it/downloads/rj.mframe)

看起来您需要安装RJ库,可以从StatET站点下载:http://download.walware.de/rj/rj_0.5.0-5.tar.gz (RJ的最新版本可以在http://www.walware.de/it/downloads/rj.mframe中找到)。

If you save that file on your desktop, you can then load it into R with the command they provided R CMD INSTALL --no-test-load rj_*.tar.gz after navigating to your desktop or wherever you saved the library file. Alternatively, you MAY be able to use the GUI interface and select Install packages from local ZIP files under Packages in R, though I haven't used R on a Mac so the layout may be slightly different.

如果您将该文件保存在您的桌面上,那么您可以使用他们提供的rcmd安装命令将其加载到R中——无测试加载rj_*.tar。在导航到桌面或保存库文件的任何地方之后。或者,您可以使用GUI界面,并从本地ZIP文件中选择安装包,但我没有在Mac上使用R,所以布局可能略有不同。

#2


6  

[rant] I also lack the reputation to put my response where it belongs. And there's no button there indicating this. Just a big screen full of nowhere desired to click upon. Negative discoverability sucks. It sucks in Eclipse and it sucks here, too. [/rant]

[怒吼]我也没有把我的回应放在该放的地方的名声。这里没有按钮表示这个。只是一个到处都是不想点击的大屏幕。-发现糟透了。它在Eclipse中很糟糕,在这里也很糟糕。[/咆哮]

I'm finding rj frustrating under Ubuntu. On my system, with each major Ubuntu upgrade with a new version of R, I have to go through this procedure over again.

我在Ubuntu下发现rj令人沮丧。在我的系统上,每一个主要的Ubuntu升级版都有一个新版本的R,我必须再次经历这个过程。

One time I tried to use a tilde (~) character in a path name within some Eclipse configuration field. This failed silently.

有一次,我尝试在某个Eclipse配置字段的路径名中使用tilde(~)字符。这个失败的默默。

My current configuration is as follows. In my ~/.Renviron file:

我现在的配置如下。在我的~ /。Renviron文件:

R_LIBS_USER=~/etc/R/amd64/2.11

Once rJava works, there is an rJava directory here. Just so I don't drive myself insane, in ~/etc/R/README I put a note that my current R configuration is controlled by ~/.Renviron

一旦rJava工作,这里就有一个rJava目录。为了不让自己发疯,在~/etc/R/README中,我注意到我当前的R配置是由~/.Renviron控制的

Somehow at one point I ended up with permission problems where

不知何故,我最终在哪里遇到了许可问题

R CMD javareconf 

was failing. Once in frustration I foolishly ran this under sudo to work around this problem, and ended up with permission problems on the generated files. Stupid! The correct fix was to make all the files in /etc/R world readable. Maybe javareconf is only important if you mess with your default Java. Previously, I was running the Sun's JRE. Since 10.10 I'm running icedtea6 and it seems to be working OK. One time it was just the thing to make my configuration work again.

是失败的。有一次,我在sudo下愚蠢地运行这个程序来解决这个问题,结果生成的文件出现了权限问题。愚蠢的!正确的修正是使/etc/R中的所有文件都可读。也许javareconf只有在使用默认Java时才重要。之前,我在运行Sun的JRE。自从10点10分开始,我就在运行icedtea6,它似乎运行得很好。有一次,我的配置又开始工作了。

Once I have the right Java binding, from command line R:

一旦我有了正确的Java绑定,从命令行R:

install.packages("rJava")

I've had file permission problems running this in the past. I think it was fixed by making all files in /etc/R world readable.

我曾经遇到过文件权限问题。我认为它是通过使/etc/R中的所有文件都可读而修复的。

The following is a useful diagnostic to see if this worked, from within any R console:

以下是一个有用的诊断,看看这是否有效,从任何R控制台:

> system.file("jri",package="rJava")
[1] "/home/allan/etc/R/amd64/2.11/rJava/jri"

If it doesn't look right under Eclipse, there is also some startup debugging available, though it took forever before I noticed this in the docs at StatET.

如果它不是在Eclipse下,也有一些启动调试可用,尽管我花了很长时间才在StatET的文档中注意到这一点。

I created an R Console run configuration for R 2.11 debug In the JRE tab add -Dde.walware.rj.verbose=true. In the Common tab, click Allocate additional Error Log Consoles.

我在JRE选项卡add -Dde.walware.rj.verbose=true中为r2.11调试创建了一个R控制台运行配置。在Common选项卡中,单击分配额外的错误日志控制台。

The main configuration options are as follows. Main tab, Launch Type: RJ. R_Config tab, you need to select a Configured R Installation, or create/edit one if you don't have one that works. Mine is Name=R, Location=/usr/lib64/R In the Environment tab I have R_LIBS_USER=/home/USER/etc/R/amd64/2.11 according to how I set things up above. Do not use the tilde (~) character here!

主要配置选项如下。主标签,启动类型:RJ。R_Config选项卡,您需要选择一个已配置的R安装,如果没有有效的安装,则需要创建/编辑一个。我的是Name=R, Location=/usr/lib64/R,在Environment选项卡中我有R_LIBS_USER=/home/USER/etc/R/amd64/2.11,这取决于我如何设置上面的内容。不要在这里使用tilde(~)字符!

If you end up mucking about with this problem as much as I did, you end up killing a lot of dead consoles. In the Main tab I added the program option --no-save. I don't think this does anything, since I can't end my console by pressing CTRL-D. In the R_Console tab, I added the following R snippet:

如果你最终像我一样对这个问题百思不得其解,你最终会杀死很多死主机。在主选项卡中,我添加了程序选项——no-save。我认为这没有任何作用,因为我不能按CTRL-D结束控制台。在R_Console选项卡中,我添加了以下R片段:

q <- function(save = "no", status = 0, runLast = TRUE){
.Internal(quit(save, status, runLast))
#<environment: namespace:base>
}

This gets rid of the annoying "save workspace" prompt when killing an R console with the red square (is that symbolic?) My current workspace also includes a C project, so my R console constantly comes up underneath a blank C-Build console. Annoying as all hell! Haven't solved that yet, but I did discover that from within a StatET code windows the keybinding CTRL-R C pulls the R console to the top.

这消除了在用红色方块杀死R控制台时令人讨厌的“保存工作区”提示符(这是象征性的吗?)我当前的工作空间还包含一个C项目,所以我的R控制台经常出现在一个空白的C构建控制台下面。讨厌所有地狱!还没有解决这个问题,但是我发现在StatET代码窗口中,键绑定CTRL-R C将R控制台拉到顶部。

With my R 2.11 debug configuration I get an extra console titled /usr/lib/jvm/java-6-openjdk/bin/java. You'll have to spelunk the console drop-down to find it. The following is a pertinent snippet of a successful initialization:

使用r2.11调试配置,我得到了一个额外的控制台,名为/usr/lib/jvm/java-6-openjdk/bin/java。您必须打开控制台下拉菜单才能找到它。以下是成功初始化的相关片段:

CONFIG: JR library path: 
    /home/allan/etc/R/amd64/2.11
    /usr/local/lib64/R/site-library
    /usr/lib64/R/library
10-Dec-2010 7:56:47 AM org.rosuda.rj.JRClassLoader addClassPath
FINE: Added '/home/allan/etc/R/amd64/2.11/rJava/java' to classpath of URL loader  

A lot more spoo, then finally:

更多的spoo,最后:

10-Dec-2010 7:56:48 AM de.walware.rj.server.jriImpl.RosudaJRIServer start
INFO: R engine started successfully. New Client-State: 'Connected'.

Looks good, right? But lo and behold in the R console:

看起来不错,对吧?但你看,在R控制台:

[INFO] The R package 'rj' is not available, R-StatET tools cannot be initialized.

Ignore the lying bastard! Turns out my rj is working just fine. No idea why this failure message persists.

忽略了撒谎的混蛋!我的rj运行得很好。不知道为什么这个失败消息会持续。

Every time around the block with this problem some new amazing piece of gravel ends up in my sneaker.

每次围绕这个问题,一些新的神奇的碎石最后在我的运动鞋里。

I don't know whether I've covered everything, but I've written enough for now. Maybe if there are comments I'll come back and fill in the blanks.

我不知道我是否涵盖了所有内容,但我现在已经写得够多了。如果有什么意见的话,我可以回来填一下。

Note: found an Eclipse plugin for console switching by keyboard here: Eclipse: Keyboard shortcut for switching between consoles?

注意:在这里找到了一个用于通过键盘切换控制台的Eclipse插件:Eclipse:用于在控制台之间切换的键盘快捷方式?

#3


3  

After installing rj with in the R console using

安装rj后在R控制台使用

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

(See http://www.walware.de/?page=/it/statet/troubleshooting.mframe for the correct rj version),

(参见http://www.walware.de/?page=/it/statet/troubleshooting.mframe获取正确的rj版本),

do not forget to update the R_LIBS variable in Eclipse (Windows -> Preferences -> StatET -> Run/Debug -> R Environments -> Edit). To find out the value just type in the R console:

不要忘记更新Eclipse中的R_LIBS变量(Windows ->首选项-> StatET ->运行/调试-> R环境->编辑)。要查找值,只需在R控制台输入:

packageDescription("rj").

In my windows 8 installation this returns C:/Users/Fibonacci.PYTHAGORAS/Documents/R/win-library/3.0/rj/Meta/package.rds. The value of R_LIBS I set to

在我的windows 8安装中,它返回C:/Users/Fibonacci.PYTHAGORAS/Documents/R/win-library/3.0/rj/Meta/package.rd。我设置为的R_LIBS的值

C:/Users/Fibonacci.PYTHAGORAS/Documents/R/win-library/3.0

which is the path where all libraries are installed.

这是安装所有库的路径。

As stated in http://www.walware.de/?page=/it/statet/troubleshooting.mframe newer versions (Versions > 0.5.5) do not need the R CMD INSTALL etc... command.

如http://www.walware.de/?page=/ it/statet/troubleshoot.mframe更新版本(版本> 0.5.5)不需要安装rcmd等…命令。

#4


1  

Here the quite similar I had and the solution I found.

这里我有一个非常相似的方法和我找到的解决方案。

I originally installed Statet using the Eclipse built-in tool "Install new software ...."

我最初安装Statet使用Eclipse内置工具“安装新软件....”

I seems it downloaded Statet + rj and that the installation process went well.

我似乎下载了Statet + rj,安装过程很顺利。

After this first installation, I tried to install both packages again. Eclipse refused reading that they already are installed. And, both packages/programs were actually listed in the window of Eclipse.

在第一次安装之后,我尝试再次安装两个包。Eclipse拒绝读取它们已经安装。而且,这两个包/程序实际上都在Eclipse窗口中列出。

But, the R console still refused to launch, the dialog box reading that I had to check whether rj was available and that the file paths were correct. Another strange thing was that window explorer had been unable to locate rj on my disk.

但是,R控制台仍然拒绝启动,我必须检查rj是否可用以及文件路径是否正确的对话框。另一件奇怪的事情是窗口浏览器无法在我的磁盘上找到rj。

???

? ? ?

To solve my whole problem, I simply downloaded rj from http://www.walware.de/ and installed this package via the r console and using the basic install.packages() command.

为了解决整个问题,我从http://www.walware.de/下载了rj,并通过r控制台安装了这个包,并使用基本的install.packages()命令。

It now works perfectly .

现在它工作得很完美。

But, I still don't understand everything ..... :-)

但是,我还是不能完全理解……:-)

#5


0  

I'd make a comment but I lack the necessary reputation. For Windows, the procedure is the same. There's no zip file. Use the tar.gz. Worked for me. The command, working from the same folder as the downloaded file:

我想做个评论,但我缺乏必要的声誉。对于Windows,过程是相同的。没有zip文件。使用tar.gz。为我工作。该命令在与下载文件相同的文件夹中工作:

$ G:\R-2.12.0\bin\i386\R.exe CMD INSTALL --no-test-load rj_*.tar.gz

$ G:\ R-2.12.0 \ bin \ i386 \ R。exe CMD安装——无测试加载rj_*.tar.gz


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.silva-art.net/blog/2010/09/16/d15c99788d6b02f28b3e152983deb079.html



 
© 2014-2018 ITdaan.com 粤ICP备14056181号