Menu
  • HOME
  • TAGS

JRI, Java and R: variable is not accumulated between evals

java,r,rjava,jri

This is the answer, need to use asDouble(): double xx = (re.eval("xx")).asDouble(); ...

write.xlsx function gives error when defining path with the file name but read.xlsx is fine

r,xlsx,rjava

Replacing "~/" with "Users//" works for Mac (probably for Linux as well). Though, it still eludes me how read.xlsx and write.xlsx could differ in such a fundamental way.

how to call Java method which returns any List from R Language? [on hold]

java,r,rjava

You can do it with rJava package. install.packages('rJava') library(rJava) .jinit() jObj=.jnew("JClass") result=.jcall(jObj,"[D","method1") Here, JClass is a Java class that should be in your ClassPath environment variable, method1 is a static method of JClass that returns double[], [D is a JNI notation for a double array. See that blog entry for...

rJava not loading in R

java,r,rjava

Ok I solved it by installing 64bit Java and clearing JAVA_HOME in R using: if (Sys.getenv("JAVA_HOME")!="") Sys.setenv(JAVA_HOME="") library(rJava) ...

Unable to load rJava on R

r,rjava

Use: Sys.setenv(JAVA_HOME='...path to JRE...') e.g. Sys.setenv(JAVA_HOME='C:\Program Files\Java\jdk1.7.0_51\jre') Your environment variable is wrong....

Setting up Java R Interface (JRI) on Windows

java,r,rjava,jri

How you instantiating Rengine? It should be something like this: Rengine rengine = new Rengine(args, false, null); where, the args could be from your main method. Let me know if this works!...

Why does rJava not work on Ubuntu 14.04 using OpenJDK 7?

java,r,openjdk,rjava,ubuntu-14.04

I had the same problem with a similar configuration (R 3.1.0, Ubuntu 12.10, 32-bit). I found the answer was in getting LD_LIBRARY_PATH set properly, as described here: error: unable to load installed packages just now except that the subdirectory in question is 'client' not 'server'. So now I'm setting my...

Using Travis with R and rJava

r,travis-ci,rjava

Please try to install r-cran-rjava directly via apt-get. There are a number of questions here on SO related to r-cran-rjava so glancing at those may help too. The Build-Depends for this package currently are default-jdk and the Depends is on openjdk-7-jre | default-jre. Relying on the package should help you...

Problems requiring rJava in Windows

r,windows,rjava

I think the problem on this occasion is that your Java is 32-bit, whereas your R is 64-bit. This is why you get a R and Java have different architectures error. In order to check what your Java version is on Windows type: java -d64 -version on the command line...

rJava: calling a Java function to retrieve a list of objects

rjava

this does the trick: print(x[[1]]$s) ...

rJava won't install on openSUSE 13.2

java,r,opensuse,rjava

Turns out the problem was missing libicu-devel package. Installing it fixed the problem.

How to represent NA in rJava

java,r,scala,rjava

Use org.rosuda.REngine.REXPDouble.NA to indicate to R that there is missing data. It is a type of Double.NaN, but different than the one that Java normally uses (so you have to specify it). You can use org.rosuda.REngine.REXPDouble.isNA to verify whether a NaN is R's missing-data NaN or an ordinary one. For...

EXCEPTION_ACCESS_VIOLATION when trying to use RJava

rjava,jri

Instanitiate rengine like below, i have just made 10 as default size. String args1[] = new String[10]; Rengine rengine = new Rengine(args, false, null); ...

JRI: how to get the console output in a Java String

rjava,jri

You have to implement org.rosuda.JRI.RMainLoopCallbacks interface - in particular rWriteConsole() will be called with each output string.

Static Java function imported with rJava doesn't work with tm_map()

java,r,tm,rjava

Finally adding mc.cores parameter has worked for me. However, It's more a workaround, than a proper solution. vc = tm_map(vc, content_transformer(stem), mc.cores=1) ...

how to pass a rJava .jnew call multiple parameters?

java,r,rjava

This document explains how to work with different constructors. See section "looking up constructors and methods". Apparently you have to call the new() function instead of / after .jnew(). I'm also still experimenting......