KNIME (eclipse-java) process disappears when trying to instantiate R in R(Interactive) nodes

I am running KNIME 2.9 and trying to learn about R integration.

I have R 3.0.1 installed on a MacBook Pro running OS X 10.9

From some of the more recent comments on this forum apparently the new R(Interactive) nodes are the best place to get started.

After trying to execute a "Table to R" node I got the following error message:

ERROR     Table to R                         Execute failed: Only R in version 2.x is supported. The R installation defined in the preferences is of version 3.x.

You can fix the problem by pointing to a valid R v2 installation or by

 - uninstalling the feature "org.knime.features.rengine.r2"

 - modifying your R installation and adding the package "rJava" (available from CRAN)

 - add a line to knime.ini: -Djava.library.path=<R-install-folder>/library/rJava/jri/x64

   (path printed to console while running install.packages("rJava") in R)

and restarting KNIME.

As I have version 3.0.1 installed this is not unreasonable. So I followed the instructions and removed the above feature, added rJava to my installation, and modified the knime.ini to the appropriate directory (incidentally the executable jars are not in the "/library/rJava/jri/x64" directory but in "/library/rJava/jri" on the Mac.)

Now I do not get any error messages but as soon as I try and configure the "Table to R" node KNIME dies and the entire processes disappears.

Reinstalling  the feature "org.knime.features.rengine.r2" gets me back to where I was with the above error.

I installed the latest version of R v2 and when it tries to instantiate R within the node the same crash occurs. Switching back to R v3 gives me the old error message.

I have tried changing Java versions from 1.6 to 1.7 with no difference in behavior.

Whenever the node tries to instantiate an R instance, either in v2 or v3 the whole KNIME process disappears.

If anyone is familiar with this failure or can confirm that it is unique to my environment can they please let me know.

Hopefully there are specific configuration changes or version changes that are necessary to avoid this problem.

I have asked this question in the R forum with no replies, I am hoping that it will get more viewers in the General forum.

Thanks,

Scott 

Hi Scott, 

Sorry, we missed your post in the R forums, have a look at our FAQ on the subject.  This should get you going...

http://tech.knime.org/faq#q25

Regards,

Aaron

Aaron,

Thanks for your reply.

The instuctions in the FAQ are similar to the ones described in the error message when trying to run the run with R v3.

I did finally manage to get it to work, the problem is that the error message and FAQ are written assuming a Windows environment.

The two things necessary to get the interactive R nodes working on the Mac, that differed from Windows.

In the kmine.ini the path to the jri library looks something like this 

  1. -Djava.library.path=/Library/Frameworks/R.framework/Versions/3.0/Resources/library/rJava/jri
    As there is no jri.dll or x64 directory the current instructions are not appropriate for the Mac
  2. (this was the one that finally got it working for me)
    The setting for the R HOME path that has to be set in the KNIME preferences is NOT /usr/bin or any variation of that but the value that gets returned from R.home()  "/Library/Frameworks/R.framework/Resources" which is an alias to the current active version of the R runtime. 
    For a fuller explanation of this see: http://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html#Why-is-R_002ehome_0028_0029-not-versioned_003f

Hopefully this helps someone else trying to use the new interactive R nodes on the Mac
 

-- Scott

Aaron,

Thanks for your reply.

The instuctions in the FAQ are similar to the ones described in the error message when trying to run the run with R v3.

I did finally manage to get it to work, the problem is that the error message and FAQ are written assuming a Windows environment.

The two things necessary to get the interactive R nodes working on the Mac, that differed from Windows.

In the kmine.ini the path to the jri library looks something like this 

  1. -Djava.library.path=/Library/Frameworks/R.framework/Versions/3.0/Resources/library/rJava/jri
    As there is no jri.dll or x64 directory the current instructions are not appropriate for the Mac
  2. (this was the one that finally got it working for me)
    The setting for the R HOME path that has to be set in the KNIME preferences is NOT /usr/bin or any variation of that but the value that gets returned from R.home()  "/Library/Frameworks/R.framework/Resources" which is an alias to the current active version of the R runtime. 
    For a fuller explanation of this see: http://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html#Why-is-R_002ehome_0028_0029-not-versioned_003f

Hopefully this helps someone else trying to use the new interactive R nodes on the Mac
 

-- Scott