This is the answer, need to use asDouble(): double xx = (re.eval("xx")).asDouble(); ...
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.
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...
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) ...
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....
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!...
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...
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...
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...
this does the trick: print(x[[1]]$s) ...
Turns out the problem was missing libicu-devel package. Installing it fixed the problem.
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...
Instanitiate rengine like below, i have just made 10 as default size. String args1[] = new String[10]; Rengine rengine = new Rengine(args, false, null); ...
You have to implement org.rosuda.JRI.RMainLoopCallbacks interface - in particular rWriteConsole() will be called with each output string.
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) ...
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......