rj error when running rj console in Eclipse using StatET plugin
I'm new to R and I use Eclipse a lot so I decided to install the StatET plugin in eclipse. Everything went smoothly except that I have the same problem as shown here...
Random true facts:
Windows XP Version 5.1.2600 Eclipse 3.6 StatET 0.9.2I tried to install rj-0.5.2-1 from here, which is the package recommended for StatET 0.9.2. I put the tar.gz file in the same directory as R.exe and successfully installed it, here is the command line output...
H:\DATA\R\R-2.13.0\bin>R CMD INSTALL --no-test-load rj_*.tar.gz
* installing to library 'H:/DATA/R/R-2.13.0/library'
* installing *source* package 'rj' ...
** R
** inst
** preparing package for lazy loading
** help
No man pages found in package 'rj'
*** installing help indices
** building package indices ...
* DONE (rj)
H:\DATA\R\R-2.13.0\bin>
When it was done I could see the rj folder in the H:\DATA\R\R-2.13.0\library folder, so I thought it worked. However when I start Eclipse and start the RJ console I still get this error message...
[INFO] The R package 'rj' is not available, R-StatET tools cannot be initialized.
I also tried installing the rj-0.5.5-3 package since the binaries are precompiled; however, that didn't work either. I still get the same error message.
I noticed that at the bottom of the stackoverflow page I posted above that there is a post by Allan Stokes that states this error message is not true. Is thi开发者_JS百科s correct? How can I tell if this error message is a Eclipse/StatET bug or that my rj package is not installed properly? Any ideas?
Not sure if it is allowed to answer your own question, but I managed to get it working and I thought I'd post my solution. For some reason R was not recognizing the rj library when it was installed on my H: drive which is a portable drive, not my system drive. I uninstalled R and reinstalled it on my C: drive, which is my system drive. I installed rJava and rj just like before and in the r console I ran...
("rj" %in% installed.packages()[,"Package"])
it returned true indicating that the package was there, this command returned false when R was installed on my H: drive. I went into Eclipse/StatET and setup my R environment with the new location of R and ran RJ and there was no error. I'm not sure why this solution worked. Maybe the rj package need to be installed in a very specific manner. I don't understand why some libraries worked on the H: drive and some didn't. The rJava package would work on the H: drive and that the rj package wouldn't. Why is this? Ah well, it's working now. The info on this mailing list helped a lot...
http://lists.r-forge.r-project.org/pipermail/statet-user/2011-March/000812.html
精彩评论