Strange error from R interactive nodes

Hi Folks,

I am running knime on a linux (redhat) workstation and each time I try to do anything with an iterative R node I get this message

Error in unique.default(unlist(lapply(x, length))) : 
  3 arguments passed to .Internal(unique) which requires 4
Error in unique.default(unlist(lapply(x, length))) : 
  3 arguments passed to .Internal(unique) which requires 4
Error in unique.default(unlist(lapply(x, length))) : 
  3 arguments passed to .Internal(unique) which requires 4

this happen even before I edit the R script window and also for all the nodes in the category: snippet, table to R, source etc.

have you seen something like this before?

thanks a lot

Giovanni

 

Hi Giovanni,

I am trying to find out the reason for the warning message. Could you please tell me the version of your R installation? Is it a 32bit auch a 64bit system?

Heiko

Hi Hofer,

the R version is 2.13.2 (2011-09-30) and it's a 64 bit system

thanks for looking into this

 

Giovanni

This problem has been addressed and fixed in KNIME 2.9

Hi Gabriel,

I upgraded to 2.9.1 but I still get the same error. is there any other upgrade or change I need to do?

thanks a lot

 

Giovanni

Sorry for that. Can you please check the steps as described in our faq entry: http://tech.knime.org/faq#q25

Gabriel,

it looks like my problem is intalling rJava on my Centos system: I've tried every suggestion found on different forums and I still can't make it work.

very frustrating!

I guess I'll stick with the non-interactive nodes untill I find a way to install rJava

thanks

Giovanni

Hello Giovanni,

What is your problem to install rJava. I also have a CentOS system and it was a little bit difficult but I finally found a way.

However, I still cannot use Knime with my R installation. In the faq you say:

3. Add a system property to your knime.ini:

-Djava.library.path=C:\...library\3.0\rJava\jri\x64

pointing to the jri.dll (make sure you point to x64 when using 64bit)

But on Linux, I think there is no dll file. Anyway, in my local installation /opt/R-2.15.2/library/rJava/jri/, there are 2 archives JRIEngine.jar and REngine.jar.

Is there a change to make it work in a different way or did I do something wrong?

By the way, on windows it works perfectly!

Nicolas
 

I believe on linux it is either a .jnilib, or a .so (I can't recall which, but on mac it is a .jnilib). Have you tried to use "/opt/R-2.15.2/library/rJava/jri/" as your path?  I think that should work. 

Regards,

Aaron

 

 

Unfortunately, I cannot find any jri.so or jri.jnilib.

I also tried -Djava.library.path=/opt/R-2.15.2/library/rJava/jri/ in my knime.ini but it does not change anything.

By the way, the R snippet console displays:

R cannot be intialized.
Cannot load JRI native library

From inside R, you should be able to find the path to rJava with: path.package("rJava")

also, the path to your executable should be accessible in R with: R.home() 

Keep us posted on your progress. 

Regards,

Aaron

Hello Aaron,

> library(rJava)
> path.package("rJava")
[1] "/opt/R-2.15.2/library/rJava"
> R.home()
[1] "/opt/R-2.15.2"

R home is correctly set in Knime preferences for "R (labs)" and I add -Djava.library.path=/opt/R-2.15.2/library/rJava to knime.ini, but R still cannot be initialized is Knime.

Is there an environment variable I should add to my .bashrc? Currently I have:

export R_HOME=/opt/R-2.15.2/
export JAVA_HOME=/usr/java/jdk1.7.0_25/jre/
export PATH=$PATH:$JAVA_HOME/bin

Thanks

Nicolas

I found a CentOS installation, and the path, as adapted for your system would be:

/opt/R-2.15.2/library/rJava/jri

Note the lack of a trailing slash.  Maybe try that?

Also, make sure that org.knime.features.rengine.r2.feature.group is uninstalled as per the FAQ.

 

 

Unfortunately, with ou without slash, it does not change the result.

org.knime.features.rengine.r2.feature.group is uninstalled.

Hi,

I had exactly the same problem here. In my case I found a solution to get R initialized which is reported below. (Unfortunately, I got stuck with a subsequent problem: http://tech.knime.org/forum/r-statistics-nodes-and-integration/r-interactive-error-in-identicalsimplify-false. Maybe you can help there?)

I'm running a Linux 64bit system, Knime 2.9.2, R 3.0.3, and followed the steps in the FAQ: http://tech.knime.org/faq#q25.

As mentioned in #8 above, my $R_HOME/library/rJava/jri/ only contains the two archives JRIEngine.jar and REngine.jar, but no *.so or *.jnilib and no x64 subfolder. Within the rJava folder, I only found one *.so file, which is rJava.so inside the $R_HOME/library/rJava/libs/ folder. However, pointing the knime.ini to this path doesn't make any difference. Whenever I tried to run (or configure) an R node, I got an error that R could not be initialized.

The important point was that I compiled R from the sources! When installing rJava within R, I found the following log messages:

checking whether JRI should be compiled (autodetect)... no
...
checking whether JRI is requested... no

So I tried to explicitly request JRI using the following command:

  > install.packages("rJava", configure.args=c("--enable-jri"))

which in turn required the R system to be build as a shared library:

  $ ./configure --enable-R-shlib  
  $ make  

Finally, after re-building R with "enable-R-shlib" option and subsequently installing rJava (which than automatically enabled jri), I got a "libjri.so" in the folder $R_HOME/library/rJava/jri/ to which I pointed the knime.ini, and Knime is able to initialize R 3.0.3.

Best, Andreas

 

Hello Andreas,

I followed what you did but at the end I still cannot initialize R in Knime...

I am curious to know which version of Java you are using?

Thanks

Nicolas

Hi Nicolas,

in Knime the included JRE ( java version "1.7.0_07") is used. In R, our system default is used (java version "1.7.0_21").

Andreas

 

I am seeing this problem as I attempt to move from Knime 2.9.4 to 2.10.0.

The R Snippet node in 2.9.4 was working fine, but when I attempt to configure the R Snippet node of 2.10.0 I get this in the R Snippet console:

  Error in unique.default(unlist(lapply(x, length))) :
    4 arguments passed to .Internal(unique) which requires 3
  Error in unique.default(unlist(lapply(x, length))) :
    4 arguments passed to .Internal(unique) which requires 3
  Error in unique.default(unlist(lapply(x, length))) :
    4 arguments passed to .Internal(unique) which requires 3

I found this thread and followed the instructions referred to above (http://tech.knime.org/faq#q25).  I added -Djava.library.path=/apps/source/R-3.0.2-mkl/lib64/R/library/rJava/jri to my knime.ini file.  Within that directory I see a libjri.so file.  When I attempted to remove org.knime.features.rengine.r2 feature.group it was already not present.  Among the features groups that are present is org.knime.features.r .

Thanks, Doug